1 // UNSUPPORTED: target={{.*}}-zos{{.*}}, target={{.*}}-aix{{.*}}
2 // Test that debug info is emitted for an Objective-C module and
3 // a precompiled header.
9 // RUN: %clang_cc1 -x objective-c -fmodules -fmodule-format=obj \
10 // RUN: -fimplicit-module-maps -DMODULES -fmodules-cache-path=%t %s \
11 // RUN: -I %S/Inputs -I %t -emit-llvm -o %t.ll \
12 // RUN: -mllvm -debug-only=pchcontainer &>%t-mod.ll
13 // RUN: cat %t-mod.ll | FileCheck %s
14 // RUN: cat %t-mod.ll | FileCheck %s --check-prefix=CHECK2
17 // RUN: %clang_cc1 -x objective-c -emit-pch -fmodule-format=obj -I %S/Inputs \
18 // RUN: -o %t.pch %S/Inputs/DebugObjC.h \
19 // RUN: -mllvm -debug-only=pchcontainer &>%t-pch.ll
20 // RUN: cat %t-pch.ll | FileCheck %s
21 // RUN: cat %t-pch.ll | FileCheck %s --check-prefix=CHECK2
27 // CHECK: distinct !DICompileUnit(language: DW_LANG_ObjC, file: ![[FILE:[0-9]+]],
28 // CHECK-SAME: isOptimized: false
30 // CHECK: ![[FILE]] = !DIFile(filename: "{{DebugObjC|.*DebugObjC.h}}"
32 // CHECK: !DICompositeType(tag: DW_TAG_enumeration_type,
33 // CHECK-SAME: scope: ![[MODULE:[0-9]+]],
34 // CHECK: ![[MODULE]] = !DIModule(scope: null, name: "DebugObjC
36 // CHECK: ![[TD_ENUM:.*]] = !DICompositeType(tag: DW_TAG_enumeration_type,
38 // CHECK-SAME: elements:
40 // CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "FwdDecl",
41 // CHECK-SAME: scope: ![[MODULE]],
43 // CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "ObjCClass",
44 // CHECK-SAME: scope: ![[MODULE]],
45 // CHECK-SAME: elements
47 // CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "ObjCClassWithPrivateIVars",
48 // CHECK-SAME: scope: ![[MODULE]],
49 // CHECK-SAME: elements
51 // CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "FwdDeclared"
52 // CHECK-SAME: elements:
54 // CHECK: ![[TD_UNION:.*]] = distinct !DICompositeType(tag: DW_TAG_union_type,
56 // CHECK-SAME: elements:
58 // CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "TypedefUnion",
59 // CHECK-SAME: baseType: ![[TD_UNION]])
61 // CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "TypedefEnum",
62 // CHECK-SAME: baseType: ![[TD_ENUM:.*]])
64 // CHECK: ![[TD_STRUCT:.*]] = distinct !DICompositeType(tag: DW_TAG_structure_type,
66 // CHECK-SAME: elements:
67 // CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "TypedefStruct",
68 // CHECK-SAME: baseType: ![[TD_STRUCT]])
70 // CHECK: !DICompositeType(tag: DW_TAG_union_type,
74 // CHECK: !DICompositeType(tag: DW_TAG_structure_type,
78 // CHECK-NEG-NOT: !DICompositeType(tag: DW_TAG_structure_type, name: "PureForwardDecl"
80 // The output order is sublty different for module vs. pch,
81 // so these are checked separately:
83 // CHECK2: !DICompositeType(tag: DW_TAG_structure_type, name: "FwdDecl",
84 // CHECK2: !DICompositeType(tag: DW_TAG_structure_type, name: "ObjCClass",
85 // CHECK2: !DIObjCProperty(name: "property",
86 // CHECK2: !DIDerivedType(tag: DW_TAG_member, name: "ivar"
87 // CHECK2: !DIDerivedType(tag: DW_TAG_typedef, name: "InnerEnum"