1 // 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 8 // 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 9 // RUN: cat %t-mod.ll | FileCheck %s 10 // RUN: cat %t-mod.ll | FileCheck --check-prefix=CHECK-NEG %s 11 // RUN: cat %t-mod.ll | FileCheck --check-prefix=CHECK-DWO %s 12 13 // PCH: 14 // 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 15 // RUN: cat %t-pch.ll | FileCheck %s 16 // RUN: cat %t-pch.ll | FileCheck --check-prefix=CHECK-NEG %s 17 18 #ifdef MODULES 19 @import DebugCXX; 20 #endif 21 22 // CHECK: distinct !DICompileUnit(language: DW_LANG_{{.*}}C_plus_plus, 23 // CHECK-SAME: isOptimized: false, 24 // CHECK-SAME-NOT: splitDebugFilename: 25 // CHECK-DWO: dwoId: 26 27 // CHECK: !DICompositeType(tag: DW_TAG_enumeration_type, name: "Enum" 28 // CHECK-SAME: identifier: "_ZTSN8DebugCXX4EnumE") 29 // CHECK: !DINamespace(name: "DebugCXX" 30 31 // CHECK: !DICompositeType(tag: DW_TAG_enumeration_type, 32 // CHECK-SAME-NOT: name: 33 // CHECK-SAME: identifier: "_ZTS11TypedefEnum") 34 35 // CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "Struct" 36 // CHECK-SAME: identifier: "_ZTSN8DebugCXX6StructE") 37 38 // CHECK: !DICompositeType(tag: DW_TAG_class_type, 39 // CHECK-SAME: name: "Template<int, DebugCXX::traits<int> >" 40 // CHECK-SAME: identifier: "_ZTSN8DebugCXX8TemplateIiNS_6traitsIiEEEE") 41 42 // CHECK: !DICompositeType(tag: DW_TAG_class_type, name: "A<void>" 43 // CHECK-SAME: identifier: "_ZTSN8DebugCXX1AIJvEEE") 44 45 // CHECK: !DICompositeType(tag: DW_TAG_class_type, 46 // CHECK-SAME: name: "Template<float, DebugCXX::traits<float> >" 47 // CHECK-SAME: identifier: "_ZTSN8DebugCXX8TemplateIfNS_6traitsIfEEEE") 48 49 // CHECK: !DICompositeType(tag: DW_TAG_class_type, name: "FwdVirtual" 50 // CHECK-SAME: elements: 51 // CHECK-SAME: identifier: "_ZTS10FwdVirtual") 52 // CHECK: !DIDerivedType(tag: DW_TAG_member, name: "_vptr$FwdVirtual" 53 54 // CHECK: !DICompositeType(tag: DW_TAG_union_type, 55 // CHECK-SAME-NOT: name: 56 // CHECK-SAME: identifier: "_ZTS12TypedefUnion") 57 58 // CHECK: !DICompositeType(tag: DW_TAG_structure_type, 59 // CHECK-SAME-NOT: name: 60 // CHECK-SAME: identifier: "_ZTS13TypedefStruct") 61 62 // CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "FloatInstatiation" 63 // no mangled name here yet. 64 65 // CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "B", 66 // no mangled name here yet. 67 68 // CHECK-NEG-NOT: !DICompositeType(tag: DW_TAG_structure_type, name: "PureForwardDecl" 69