2 for FILE in `seq 3`; do
3 clang -g -c X86/odr-fwd-declaration2.cpp -DFILE$FILE -o Inputs/odr-fwd-declaration2/$FILE.o
7 // RUN: dsymutil -f -oso-prepend-path=%p/../Inputs/odr-fwd-declaration2 -y %p/dummy-debug-map.map -o - | llvm-dwarfdump -v -debug-info - | FileCheck %s
22 // First we confirm that bPtr, bRef and bPtrToField reference the forward
23 // declaration of the struct B.
25 // CHECK: DW_TAG_member
26 // CHECK-NOT: {{DW_TAG|NULL}}
27 // CHECK: AT_name{{.*}} "bPtr"
28 // CHECK-NOT: {{DW_TAG|NULL}}
29 // CHECK: AT_type{{.*}}0x{{0*}}[[PTR1:[a-f0-9]*]]
31 // CHECK: [[STRUCT1:[a-f0-9]*]]:{{.*}}TAG_structure_type
32 // CHECK-NOT: {{DW_TAG|NULL}}
33 // CHECK: AT_name{{.*}} "B"
34 // CHECK-NOT: AT_byte_size
35 // CHECK: DW_AT_declaration
37 // CHECK: DW_TAG_member
38 // CHECK: AT_name{{.*}} "bRef"
39 // CHECK-NOT: {{DW_TAG|NULL}}
40 // CHECK: AT_type{{.*}}0x{{0*}}[[REF1:[a-f0-9]*]]
43 // CHECK-NOT: {{DW_TAG|NULL}}
44 // CHECK: AT_name{{.*}} "bPtrToField"
45 // CHECK-NOT: {{DW_TAG|NULL}}
46 // CHECK: AT_type{{.*}}0x{{0*}}[[PTRTOMEMBER1:[a-f0-9]*]]
48 // CHECK: [[PTR1]]:{{.*}}TAG_pointer_type
49 // CHECK-NOT: {{DW_TAG|NULL}}
50 // CHECK: AT_type{{.*}}0x{{0*}}[[STRUCT1]]
52 // CHECK: [[REF1]]:{{.*}}TAG_reference_type
53 // CHECK-NOT: {{DW_TAG|NULL}}
54 // CHECK: AT_type{{.*}}0x{{0*}}[[STRUCT1]]
56 // CHECK: [[PTRTOMEMBER1]]:{{.*}}TAG_ptr_to_member_type
57 // CHECK-NOT: {{DW_TAG|NULL}}
58 // CHECK: AT_containing_type{{.*}}0x{{0*}}[[STRUCT1]]
76 // Next we confirm that bPtr, bRef and bPtrToField reference the definition of
77 // B, rather than its declaration.
79 // CHECK: [[STRUCTA:[a-f0-9]*]]:{{.*}}TAG_structure_type
80 // CHECK-NOT: {{DW_TAG|NULL}}
81 // CHECK: AT_name{{.*}} "A"
82 // CHECK-NOT: AT_byte_size
83 // CHECK: DW_AT_byte_size
85 // CHECK: DW_TAG_member
86 // CHECK-NOT: {{DW_TAG|NULL}}
87 // CHECK: AT_name{{.*}} "bPtr"
88 // CHECK-NOT: {{DW_TAG|NULL}}
89 // CHECK: AT_type{{.*}}0x{{0*}}[[PTR2:[a-f0-9]*]]
91 // CHECK: [[STRUCT2:[a-f0-9]*]]:{{.*}}TAG_structure_type
92 // CHECK-NOT: {{DW_TAG|NULL}}
93 // CHECK: AT_name{{.*}} "B"
94 // CHECK-NOT: {{DW_TAG|NULL}}
95 // CHECK: DW_AT_byte_size
97 // CHECK: DW_TAG_member
98 // CHECK: AT_name{{.*}} "bRef"
99 // CHECK-NOT: {{DW_TAG|NULL}}
100 // CHECK: AT_type{{.*}}0x{{0*}}[[REF2:[a-f0-9]*]]
103 // CHECK-NOT: {{DW_TAG|NULL}}
104 // CHECK: AT_name{{.*}} "bPtrToField"
105 // CHECK-NOT: {{DW_TAG|NULL}}
106 // CHECK: AT_type{{.*}}0x{{0*}}[[PTRTOMEMBER2:[a-f0-9]*]]
108 // CHECK: [[PTR2]]:{{.*}}TAG_pointer_type
109 // CHECK-NOT: {{DW_TAG|NULL}}
110 // CHECK: AT_type{{.*}}0x{{0*}}[[STRUCT2]]
112 // CHECK: [[REF2]]:{{.*}}TAG_reference_type
113 // CHECK-NOT: {{DW_TAG|NULL}}
114 // CHECK: AT_type{{.*}}0x{{0*}}[[STRUCT2]]
116 // CHECK: [[PTRTOMEMBER2]]:{{.*}}TAG_ptr_to_member_type
117 // CHECK-NOT: {{DW_TAG|NULL}}
118 // CHECK: AT_containing_type{{.*}}0x{{0*}}[[STRUCT2:[a-f0-9]*]]
136 // Finally we confirm that uniquing isn't broken by checking that further
137 // references to 'struct A' point to its now complete definition.
139 // CHECK: TAG_variable
140 // CHECK-NOT: {{DW_TAG|NULL}}
141 // CHECK: AT_name{{.*}} "ptr2"
142 // CHECK-NOT: {{DW_TAG|NULL}}
143 // CHECK: AT_type{{.*}}0x{{0*}}[[PTR3:[a-f0-9]*]]
145 // CHECK: [[PTR3]]:{{.*}}TAG_pointer_type
146 // CHECK-NOT: {{DW_TAG|NULL}}
147 // CHECK: AT_type{{.*}}0x{{0*}}[[STRUCTA]]
150 #error "You must define which file you generate"