blob: ca66a318925e0093faf1bb1f8afc2e95721e9a64 [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
Douglas Katzman3459ce22015-10-08 04:24:12 +00008// RUN: %clang_cc1 -triple %itanium_abi_triple -x objective-c++ -std=c++11 -debug-info-kind=limited -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 Prantla5206ce2015-09-22 23:26:43 +000010// RUN: cat %t-mod.ll | FileCheck --check-prefix=CHECK-DWO %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
15
16#ifdef MODULES
17@import DebugCXX;
18#endif
19
20// CHECK: distinct !DICompileUnit(language: DW_LANG_{{.*}}C_plus_plus,
21// CHECK-SAME: isOptimized: false,
Adrian Prantla5206ce2015-09-22 23:26:43 +000022// CHECK-SAME-NOT: splitDebugFilename:
23// CHECK-DWO: dwoId:
Adrian Prantlb3b821f2016-01-06 19:22:19 +000024
Adrian Prantl4aa2b3a2015-09-08 19:20:27 +000025// CHECK: !DICompositeType(tag: DW_TAG_enumeration_type, name: "Enum"
26// CHECK-SAME: identifier: "_ZTSN8DebugCXX4EnumE")
27// CHECK: !DINamespace(name: "DebugCXX"
Adrian Prantlb3b821f2016-01-06 19:22:19 +000028
Adrian Prantl4aa2b3a2015-09-08 19:20:27 +000029// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "Struct"
30// CHECK-SAME: identifier: "_ZTSN8DebugCXX6StructE")
Adrian Prantlb3b821f2016-01-06 19:22:19 +000031
Adrian Prantl4aa2b3a2015-09-08 19:20:27 +000032// CHECK: !DICompositeType(tag: DW_TAG_class_type,
33// CHECK-SAME: name: "Template<int, DebugCXX::traits<int> >"
34// CHECK-SAME: identifier: "_ZTSN8DebugCXX8TemplateIiNS_6traitsIiEEEE")
Adrian Prantlb3b821f2016-01-06 19:22:19 +000035
36// CHECK: !DICompositeType(tag: DW_TAG_class_type, name: "A<void>"
37// CHECK-SAME: identifier: "_ZTSN8DebugCXX1AIJvEEE")
38
Adrian Prantl4aa2b3a2015-09-08 19:20:27 +000039// CHECK: !DICompositeType(tag: DW_TAG_class_type,
40// CHECK-SAME: name: "Template<float, DebugCXX::traits<float> >"
41// CHECK-SAME: identifier: "_ZTSN8DebugCXX8TemplateIfNS_6traitsIfEEEE")
Adrian Prantlb3b821f2016-01-06 19:22:19 +000042
43// CHECK: !DICompositeType(tag: DW_TAG_class_type, name: "FwdVirtual"
44// CHECK-SAME: elements:
45// CHECK-SAME: identifier: "_ZTS10FwdVirtual")
46// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "_vptr$FwdVirtual"
47
Adrian Prantl4aa2b3a2015-09-08 19:20:27 +000048// CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "FloatInstatiation"
49// no mangled name here yet.
Adrian Prantlb3b821f2016-01-06 19:22:19 +000050
Adrian Prantl4aa2b3a2015-09-08 19:20:27 +000051// CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "B",
52// no mangled name here yet.