2015-09-09 03:20:27 +08:00
|
|
|
// Test that (the same) debug info is emitted for an Objective-C++
|
|
|
|
// module and a C++ precompiled header.
|
|
|
|
|
2016-10-21 07:11:45 +08:00
|
|
|
// REQUIRES: asserts
|
2015-09-09 03:20:27 +08:00
|
|
|
|
|
|
|
// Modules:
|
|
|
|
// RUN: rm -rf %t
|
2018-01-04 03:10:21 +08:00
|
|
|
// RUN: %clang_cc1 -triple %itanium_abi_triple -x objective-c++ -std=c++11 -debugger-tuning=lldb -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
|
2015-09-09 03:20:27 +08:00
|
|
|
// RUN: cat %t-mod.ll | FileCheck %s
|
2016-01-09 09:11:35 +08:00
|
|
|
// RUN: cat %t-mod.ll | FileCheck --check-prefix=CHECK-NEG %s
|
2018-01-04 03:10:21 +08:00
|
|
|
// RUN: cat %t-mod.ll | FileCheck --check-prefix=CHECK-MOD %s
|
2015-09-09 03:20:27 +08:00
|
|
|
|
|
|
|
// PCH:
|
2018-01-04 03:10:21 +08:00
|
|
|
// RUN: %clang_cc1 -triple %itanium_abi_triple -x c++ -std=c++11 -debugger-tuning=lldb -emit-pch -fmodule-format=obj -I %S/Inputs -o %t.pch %S/Inputs/DebugCXX.h -mllvm -debug-only=pchcontainer &>%t-pch.ll
|
2019-09-24 08:38:49 +08:00
|
|
|
// RUN: cat %t-pch.ll | FileCheck --check-prefix=CHECK-CXX %s
|
2016-01-09 09:11:35 +08:00
|
|
|
// RUN: cat %t-pch.ll | FileCheck --check-prefix=CHECK-NEG %s
|
2015-09-09 03:20:27 +08:00
|
|
|
|
|
|
|
#ifdef MODULES
|
|
|
|
@import DebugCXX;
|
|
|
|
#endif
|
|
|
|
|
2018-01-04 03:10:21 +08:00
|
|
|
// CHECK-MOD: distinct !DICompileUnit(language: DW_LANG_{{.*}}C_plus_plus,
|
|
|
|
// CHECK-MOD: distinct !DICompileUnit(language: DW_LANG_{{.*}}C_plus_plus,
|
|
|
|
|
2015-09-09 03:20:27 +08:00
|
|
|
// CHECK: distinct !DICompileUnit(language: DW_LANG_{{.*}}C_plus_plus,
|
2019-09-24 08:38:49 +08:00
|
|
|
// CHECK-CXX: distinct !DICompileUnit(language: DW_LANG_C_plus_plus_11,
|
2015-09-09 03:20:27 +08:00
|
|
|
// CHECK-SAME: isOptimized: false,
|
2016-02-10 08:38:15 +08:00
|
|
|
// CHECK-NOT: splitDebugFilename:
|
|
|
|
// CHECK-SAME: dwoId:
|
2016-01-07 03:22:19 +08:00
|
|
|
|
2015-09-09 03:20:27 +08:00
|
|
|
// CHECK: !DICompositeType(tag: DW_TAG_enumeration_type, name: "Enum"
|
|
|
|
// CHECK-SAME: identifier: "_ZTSN8DebugCXX4EnumE")
|
|
|
|
// CHECK: !DINamespace(name: "DebugCXX"
|
2016-01-07 03:22:19 +08:00
|
|
|
|
2018-01-04 03:10:21 +08:00
|
|
|
// CHECK-MOD: ![[DEBUGCXX:.*]] = !DIModule(scope: null, name: "DebugCXX
|
|
|
|
|
2016-01-20 07:42:44 +08:00
|
|
|
// CHECK: !DICompositeType(tag: DW_TAG_enumeration_type,
|
2016-02-10 08:38:15 +08:00
|
|
|
// CHECK-NOT: name:
|
|
|
|
// CHECK-SAME: )
|
2016-01-20 07:42:44 +08:00
|
|
|
|
|
|
|
// CHECK: !DICompositeType(tag: DW_TAG_enumeration_type,
|
2016-02-10 08:38:15 +08:00
|
|
|
// CHECK-NOT: name:
|
|
|
|
// CHECK-SAME: )
|
2016-01-20 07:42:44 +08:00
|
|
|
|
2016-01-20 02:02:47 +08:00
|
|
|
// CHECK: !DICompositeType(tag: DW_TAG_enumeration_type,
|
2016-02-10 08:38:15 +08:00
|
|
|
// CHECK-NOT: name:
|
2016-01-20 02:02:47 +08:00
|
|
|
// CHECK-SAME: identifier: "_ZTS11TypedefEnum")
|
|
|
|
|
2016-01-20 07:42:44 +08:00
|
|
|
// CHECK: !DICompositeType(tag: DW_TAG_enumeration_type,
|
2016-02-10 08:38:15 +08:00
|
|
|
// CHECK-NOT: name:
|
|
|
|
// CHECK-SAME: )
|
2018-02-13 00:12:52 +08:00
|
|
|
// CHECK: !DIEnumerator(name: "e5", value: 5, isUnsigned: true)
|
2016-01-20 07:42:44 +08:00
|
|
|
|
2015-09-09 03:20:27 +08:00
|
|
|
// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "Struct"
|
|
|
|
// CHECK-SAME: identifier: "_ZTSN8DebugCXX6StructE")
|
2016-01-07 03:22:19 +08:00
|
|
|
|
2016-04-26 04:52:40 +08:00
|
|
|
// This type is anchored by an explicit template instantiation.
|
|
|
|
// CHECK: !DICompositeType(tag: DW_TAG_class_type,
|
2020-05-26 21:43:52 +08:00
|
|
|
// CHECK-SAME: name: "Template<int, DebugCXX::traits<int> >"
|
2016-08-18 02:27:24 +08:00
|
|
|
// CHECK-SAME: elements:
|
2016-04-26 04:52:40 +08:00
|
|
|
// CHECK-SAME: templateParams:
|
2015-09-09 03:20:27 +08:00
|
|
|
// CHECK-SAME: identifier: "_ZTSN8DebugCXX8TemplateIiNS_6traitsIiEEEE")
|
2016-01-07 03:22:19 +08:00
|
|
|
|
2016-04-26 04:52:40 +08:00
|
|
|
// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "traits<int>"
|
|
|
|
// CHECK-SAME: flags: DIFlagFwdDecl
|
|
|
|
// CHECK-SAME: identifier: "_ZTSN8DebugCXX6traitsIiEE")
|
|
|
|
|
|
|
|
// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "traits<float>"
|
2016-08-18 02:27:24 +08:00
|
|
|
// CHECK-SAME: elements:
|
2016-04-26 04:52:40 +08:00
|
|
|
// CHECK-SAME: templateParams:
|
|
|
|
// CHECK-SAME: identifier: "_ZTSN8DebugCXX6traitsIfEE")
|
|
|
|
|
|
|
|
// CHECK: !DICompositeType(tag: DW_TAG_class_type,
|
2020-05-26 21:43:52 +08:00
|
|
|
// CHECK-SAME: name: "Template<long, DebugCXX::traits<long> >"
|
2016-08-18 02:27:24 +08:00
|
|
|
// CHECK-SAME: elements:
|
2016-04-26 04:52:40 +08:00
|
|
|
// CHECK-SAME: templateParams:
|
|
|
|
// CHECK-SAME: identifier: "_ZTSN8DebugCXX8TemplateIlNS_6traitsIlEEEE")
|
|
|
|
|
2020-05-27 19:58:21 +08:00
|
|
|
// This type is anchored by a function parameter.
|
|
|
|
// CHECK: !DICompositeType(tag: DW_TAG_class_type, name: "A<void>"
|
|
|
|
// CHECK-SAME: elements:
|
|
|
|
// CHECK-SAME: templateParams:
|
|
|
|
// CHECK-SAME: identifier: "_ZTSN8DebugCXX1AIJvEEE")
|
|
|
|
|
2016-04-26 04:52:40 +08:00
|
|
|
// CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "FloatInstantiation"
|
2016-04-24 05:08:27 +08:00
|
|
|
// no mangled name here yet.
|
2016-01-07 03:22:19 +08:00
|
|
|
|
2016-04-26 04:52:40 +08:00
|
|
|
// CHECK: !DICompositeType(tag: DW_TAG_class_type,
|
2020-05-26 21:43:52 +08:00
|
|
|
// CHECK-SAME: name: "Template<float, DebugCXX::traits<float> >"
|
2016-04-26 04:52:40 +08:00
|
|
|
// CHECK-SAME: flags: DIFlagFwdDecl
|
2015-09-09 03:20:27 +08:00
|
|
|
// CHECK-SAME: identifier: "_ZTSN8DebugCXX8TemplateIfNS_6traitsIfEEEE")
|
2016-01-07 03:22:19 +08:00
|
|
|
|
2020-05-27 19:58:21 +08:00
|
|
|
// CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "B",
|
|
|
|
// no mangled name here yet.
|
|
|
|
|
2017-07-25 07:48:51 +08:00
|
|
|
// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "Virtual"
|
2016-01-07 03:22:19 +08:00
|
|
|
// CHECK-SAME: elements:
|
2017-07-25 07:48:51 +08:00
|
|
|
// CHECK-SAME: identifier: "_ZTS7Virtual")
|
|
|
|
// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "_vptr$Virtual"
|
2016-01-07 03:22:19 +08:00
|
|
|
|
2016-01-20 02:02:47 +08:00
|
|
|
// CHECK: !DICompositeType(tag: DW_TAG_union_type,
|
2016-02-10 08:38:15 +08:00
|
|
|
// CHECK-NOT: name:
|
2016-01-20 02:02:47 +08:00
|
|
|
// CHECK-SAME: identifier: "_ZTS12TypedefUnion")
|
|
|
|
|
|
|
|
// CHECK: !DICompositeType(tag: DW_TAG_structure_type,
|
2016-02-10 08:38:15 +08:00
|
|
|
// CHECK-NOT: name:
|
2016-01-20 02:02:47 +08:00
|
|
|
// CHECK-SAME: identifier: "_ZTS13TypedefStruct")
|
|
|
|
|
2016-01-20 07:42:44 +08:00
|
|
|
// CHECK: !DICompositeType(tag: DW_TAG_union_type,
|
2016-02-10 08:38:15 +08:00
|
|
|
// CHECK-NOT: name:
|
|
|
|
// CHECK-SAME: )
|
2016-01-20 07:42:44 +08:00
|
|
|
|
|
|
|
// CHECK: !DICompositeType(tag: DW_TAG_structure_type,
|
2016-02-10 08:38:15 +08:00
|
|
|
// CHECK-NOT: name:
|
|
|
|
// CHECK-SAME: )
|
2016-01-20 07:42:44 +08:00
|
|
|
|
2016-01-20 09:29:34 +08:00
|
|
|
// CHECK: !DICompositeType(tag: DW_TAG_structure_type,
|
|
|
|
// CHECK-SAME: name: "InAnonymousNamespace",
|
|
|
|
// CHECK-SAME: elements: !{{[0-9]+}})
|
|
|
|
|
2017-07-25 07:48:51 +08:00
|
|
|
// CHECK: ![[A:.*]] = {{.*}}!DICompositeType(tag: DW_TAG_class_type, name: "A",
|
|
|
|
// CHECK-SAME: elements:
|
2019-04-26 04:05:47 +08:00
|
|
|
// CHECK-SAME: vtableHolder: ![[A]])
|
2017-07-25 07:48:51 +08:00
|
|
|
|
2016-04-26 04:52:40 +08:00
|
|
|
// CHECK: ![[DERIVED:.*]] = {{.*}}!DICompositeType(tag: DW_TAG_class_type, name: "Derived",
|
|
|
|
// CHECK-SAME: identifier: "_ZTS7Derived")
|
2016-04-24 05:08:27 +08:00
|
|
|
// CHECK: !DICompositeType(tag: DW_TAG_class_type, name: "B", scope: ![[DERIVED]],
|
2016-04-26 04:52:40 +08:00
|
|
|
// CHECK-SAME: elements: ![[B_MBRS:.*]], vtableHolder:
|
2016-04-24 05:08:27 +08:00
|
|
|
// CHECK: ![[B_MBRS]] = !{{{.*}}, ![[GET_PARENT:.*]]}
|
|
|
|
// CHECK: ![[GET_PARENT]] = !DISubprogram(name: "getParent"
|
|
|
|
|
2016-04-26 04:52:40 +08:00
|
|
|
// CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "TypedefTemplate",
|
|
|
|
// CHECK-SAME: baseType: ![[BASE:.*]])
|
|
|
|
// CHECK: ![[BASE]] = !DICompositeType(tag: DW_TAG_class_type,
|
|
|
|
// CHECK-SAME: name: "Template1<void *>",
|
2020-04-08 00:24:18 +08:00
|
|
|
// CHECK-SAME: flags: DIFlagFwdDecl
|
2016-04-26 04:52:40 +08:00
|
|
|
// CHECK-SAME: identifier: "_ZTS9Template1IPvE")
|
|
|
|
|
2016-07-22 02:43:20 +08:00
|
|
|
// Explicit instantiation.
|
2016-04-26 04:52:40 +08:00
|
|
|
// CHECK: !DICompositeType(tag: DW_TAG_class_type, name: "Template1<int>",
|
|
|
|
// CHECK-SAME: templateParams:
|
|
|
|
// CHECK-SAME: identifier: "_ZTS9Template1IiE")
|
|
|
|
|
|
|
|
// CHECK: !DICompositeType(tag: DW_TAG_class_type, name: "FwdDeclTemplate<int>",
|
|
|
|
// CHECK-SAME: flags: DIFlagFwdDecl
|
|
|
|
// CHECK-SAME: identifier: "_ZTS15FwdDeclTemplateIiE")
|
|
|
|
|
2016-04-27 07:37:38 +08:00
|
|
|
// Forward-declared member of a template.
|
|
|
|
// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "Member",
|
|
|
|
// CHECK-SAME: flags: DIFlagFwdDecl
|
|
|
|
// CHECK-SAME: identifier: "_ZTSN21FwdDeclTemplateMemberIiE6MemberE")
|
2016-04-26 04:52:40 +08:00
|
|
|
|
2016-08-18 02:27:24 +08:00
|
|
|
// CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "SpecializedBase",
|
|
|
|
// CHECK-SAME: baseType: ![[SPECIALIZEDBASE:.*]])
|
|
|
|
// CHECK: ![[SPECIALIZEDBASE]] = !DICompositeType(tag: DW_TAG_class_type,
|
|
|
|
// CHECK-SAME: name: "WithSpecializedBase<float>",
|
2020-04-08 00:24:18 +08:00
|
|
|
// CHECK-SAME: flags: DIFlagFwdDecl
|
2016-08-18 02:27:24 +08:00
|
|
|
|
2018-01-04 03:10:21 +08:00
|
|
|
// CHECK-MOD: !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: ![[DEBUGCXX]],
|
|
|
|
// CHECK-MOD-SAME: entity: ![[DUMMY:[0-9]+]],
|
|
|
|
// CHECK-MOD-SAME: line: 3)
|
|
|
|
// CHECK-MOD: ![[DUMMY]] = !DIModule(scope: null, name: "dummy",
|
|
|
|
// CHECK-MOD: distinct !DICompileUnit(language: DW_LANG_ObjC_plus_plus,
|
|
|
|
// CHECK-MOD-SAME: splitDebugFilename: "{{.*}}dummy{{.*}}.pcm",
|
|
|
|
|
2016-01-09 09:11:35 +08:00
|
|
|
// CHECK-NEG-NOT: !DICompositeType(tag: DW_TAG_structure_type, name: "PureForwardDecl"
|