ModuleDebugInfo.m
3.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
// Test that debug info is emitted for an Objective-C module and
// a precompiled header.
// REQUIRES: asserts
// Modules:
// RUN: rm -rf %t
// RUN: %clang_cc1 -x objective-c -fmodules -fmodule-format=obj \
// RUN: -fimplicit-module-maps -DMODULES -fmodules-cache-path=%t %s \
// RUN: -I %S/Inputs -I %t -emit-llvm -o %t.ll \
// RUN: -mllvm -debug-only=pchcontainer &>%t-mod.ll
// RUN: cat %t-mod.ll | FileCheck %s
// RUN: cat %t-mod.ll | FileCheck %s --check-prefix=CHECK2
// PCH:
// RUN: %clang_cc1 -x objective-c -emit-pch -fmodule-format=obj -I %S/Inputs \
// RUN: -o %t.pch %S/Inputs/DebugObjC.h \
// RUN: -mllvm -debug-only=pchcontainer &>%t-pch.ll
// RUN: cat %t-pch.ll | FileCheck %s
// RUN: cat %t-pch.ll | FileCheck %s --check-prefix=CHECK2
#ifdef MODULES
@import DebugObjC;
#endif
// CHECK: distinct !DICompileUnit(language: DW_LANG_ObjC, file: ![[FILE:[0-9]+]],
// CHECK-SAME: isOptimized: false
// CHECK: ![[FILE]] = !DIFile(filename: "{{DebugObjC|.*DebugObjC.h}}"
// CHECK: !DICompositeType(tag: DW_TAG_enumeration_type,
// CHECK-SAME: scope: ![[MODULE:[0-9]+]],
// CHECK: ![[MODULE]] = !DIModule(scope: null, name: "DebugObjC
// CHECK: ![[TD_ENUM:.*]] = !DICompositeType(tag: DW_TAG_enumeration_type,
// CHECK-NOT: name:
// CHECK-SAME: elements:
// CHECK: !DISubprogram(name: "+[ObjCClass classMethod]",
// CHECK-SAME: scope: ![[MODULE]],
// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "ObjCClass",
// CHECK-SAME: scope: ![[MODULE]],
// CHECK-SAME: elements
// The forward declaration should not be in the module scope.
// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "OpaqueData", file
// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "FwdDecl",
// CHECK-SAME: scope: ![[MODULE]],
// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "ObjCClassWithPrivateIVars",
// CHECK-SAME: scope: ![[MODULE]],
// CHECK-SAME: elements
// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "FwdDeclared"
// CHECK-SAME: elements:
// CHECK: ![[TD_UNION:.*]] = distinct !DICompositeType(tag: DW_TAG_union_type,
// CHECK-NOT: name:
// CHECK-SAME: elements:
// CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "TypedefUnion",
// CHECK-SAME: baseType: ![[TD_UNION]])
// CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "TypedefEnum",
// CHECK-SAME: baseType: ![[TD_ENUM:.*]])
// CHECK: ![[TD_STRUCT:.*]] = distinct !DICompositeType(tag: DW_TAG_structure_type,
// CHECK-NOT: name:
// CHECK-SAME: elements:
// CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "TypedefStruct",
// CHECK-SAME: baseType: ![[TD_STRUCT]])
// CHECK: !DICompositeType(tag: DW_TAG_union_type,
// CHECK-NOT: name:
// CHECK-SAME: )
// CHECK: !DICompositeType(tag: DW_TAG_structure_type,
// CHECK-NOT: name:
// CHECK-SAME: )
// CHECK-NEG-NOT: !DICompositeType(tag: DW_TAG_structure_type, name: "PureForwardDecl"
// The output order is sublty different for module vs. pch,
// so these are checked separately:
//
// CHECK2: !DISubprogram(name: "+[ObjCClass classMethod]"
// CHECK2: !DISubprogram(name: "-[ObjCClass instanceMethodWithInt:]"
// CHECK2: !DICompositeType(tag: DW_TAG_structure_type, name: "ObjCClass",
// CHECK2: !DIObjCProperty(name: "property",
// CHECK2: !DIDerivedType(tag: DW_TAG_member, name: "ivar"
// CHECK2: !DISubprogram(name: "-[Category(Category) categoryMethod]"
// CHECK2: !DICompositeType(tag: DW_TAG_structure_type, name: "FwdDecl",
// CHECK2: !DIDerivedType(tag: DW_TAG_typedef, name: "InnerEnum"