blob: a23c2459a9004f5bacbaf29779433790a98db462 [file] [log] [blame]
Adrian Prantl4aa2b3a2015-09-08 19:20:27 +00001// Test that (the same) debug info is emitted for an Objective-C++
2// module and a C++ precompiled header.
3
4// REQUIRES: asserts, shell
5
6// Modules:
7// RUN: rm -rf %t
NAKAMURA Takumi0981f732015-09-08 22:47:32 +00008// RUN: %clang_cc1 -triple %itanium_abi_triple -x objective-c++ -std=c++11 -g -fmodules -fmodule-format=obj -fimplicit-module-maps -DMODULES -fmodules-cache-path=%t %s -I %S/Inputs -I %t -emit-llvm -o %t.ll -mllvm -debug-only=pchcontainer &>%t-mod.ll
Adrian Prantl4aa2b3a2015-09-08 19:20:27 +00009// RUN: cat %t-mod.ll | FileCheck %s
Adrian Prantl54a34572015-09-10 17:13:31 +000010// RUN: cat %t-mod.ll | FileCheck --check-prefix=CHECK-NEG %s
Adrian Prantl4aa2b3a2015-09-08 19:20:27 +000011
12// PCH:
NAKAMURA Takumi0981f732015-09-08 22:47:32 +000013// RUN: %clang_cc1 -triple %itanium_abi_triple -x c++ -std=c++11 -emit-pch -fmodule-format=obj -I %S/Inputs -o %t.pch %S/Inputs/DebugCXX.h -mllvm -debug-only=pchcontainer &>%t-pch.ll
Adrian Prantl4aa2b3a2015-09-08 19:20:27 +000014// RUN: cat %t-pch.ll | FileCheck %s
Adrian Prantl54a34572015-09-10 17:13:31 +000015// RUN: cat %t-mod.ll | FileCheck --check-prefix=CHECK-NEG %s
Adrian Prantl4aa2b3a2015-09-08 19:20:27 +000016
17#ifdef MODULES
18@import DebugCXX;
19#endif
20
21// CHECK: distinct !DICompileUnit(language: DW_LANG_{{.*}}C_plus_plus,
22// CHECK-SAME: isOptimized: false,
23// CHECK-SAME: splitDebugFilename:
24// CHECK: !DICompositeType(tag: DW_TAG_enumeration_type, name: "Enum"
25// CHECK-SAME: identifier: "_ZTSN8DebugCXX4EnumE")
26// CHECK: !DINamespace(name: "DebugCXX"
27// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "Struct"
28// CHECK-SAME: identifier: "_ZTSN8DebugCXX6StructE")
29// CHECK: !DICompositeType(tag: DW_TAG_class_type,
30// CHECK-SAME: name: "Template<int, DebugCXX::traits<int> >"
31// CHECK-SAME: identifier: "_ZTSN8DebugCXX8TemplateIiNS_6traitsIiEEEE")
32// CHECK: !DICompositeType(tag: DW_TAG_class_type,
33// CHECK-SAME: name: "Template<float, DebugCXX::traits<float> >"
34// CHECK-SAME: identifier: "_ZTSN8DebugCXX8TemplateIfNS_6traitsIfEEEE")
Adrian Prantl4aa2b3a2015-09-08 19:20:27 +000035// CHECK: !DICompositeType(tag: DW_TAG_class_type, name: "A<void>"
36// CHECK-SAME: identifier: "_ZTSN8DebugCXX1AIJvEEE")
37// CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "FloatInstatiation"
38// no mangled name here yet.
39// CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "B",
40// no mangled name here yet.
Adrian Prantl54a34572015-09-10 17:13:31 +000041
42// CHECK-NEG-NOT: "_ZTSN8DebugCXX8TemplateIlNS_6traitsIlEEEE"