1 ## This test checks output of dsymutil for the incorrect DWARF.
2 ## CU1 has a type which references type in CU2. This referenced
3 ## type references the same type in CU1 back. There is a recursive
4 ## dependence between these two types. dsymutil should report a error,
5 ## remove CU1 and CU2, put only CU3 into the output.
7 # RUN: yaml2obj %s -o %t.o
8 # RUN: echo '---' > %t2.map
9 # RUN: echo "triple: 'x86_64-apple-darwin'" >> %t2.map
10 # RUN: echo 'objects:' >> %t2.map
11 # RUN: echo " - filename: '%t.o'" >> %t2.map
12 # RUN: echo ' symbols:' >> %t2.map
13 # RUN: echo ' - { sym: __Z3foov, objAddr: 0x0, binAddr: 0x10000, size: 0x10 }' >> %t2.map
14 # RUN: echo '...' >> %t2.map
15 # RUN: dsymutil --linker parallel -y %t2.map --num-threads 1 -f -o %t1.out 2>&1 \
16 # RUN: | FileCheck --check-prefix ERROR %s
17 # RUN: llvm-dwarfdump -a %t1.out | FileCheck %s
19 # ERROR: error: Cann't parse input DWARF. Recursive dependence.
20 # ERROR: while processing CU1
21 # ERROR: error: Cann't resolve DIE reference
22 # ERROR: while processing CU2
24 # CHECK: file format Mach-O 64-bit x86-64
25 # CHECK: .debug_info contents:
26 # CHECK: Compile Unit:
27 # CHECK: DW_TAG_compile_unit
28 # CHECK: DW_AT_name{{.*}}"__artificial_type_unit"
29 # CHECK: 0x[[CLASS1:[0-9a-f]*]]: DW_TAG_class_type{{.*[[:space:]].*}}DW_AT_name{{.*}}"class1"
31 # CHECK: Compile Unit:
32 # CHECK: DW_TAG_compile_unit
35 # CHECK: DW_AT_name{{.*}}"CU3"
36 # CHECK-NOT: DW_TAG_class_type
37 # CHECK: DW_TAG_variable
38 # CHECK: DW_AT_name{{.*}}"var3"
39 # CHECK: DW_AT_const_value
40 # CHECK: DW_AT_type (0x00000000[[CLASS1]]
42 # CHECK-NOT: Compile Unit:
48 cpusubtype: 0x00000003
67 - sectname: __debug_abbrev
69 addr: 0x000000000000000F
79 - sectname: __debug_info
81 addr: 0x000000000000100
125 - Tag: DW_TAG_compile_unit
126 Children: DW_CHILDREN_yes
128 - Attribute: DW_AT_producer
130 - Attribute: DW_AT_language
132 - Attribute: DW_AT_name
134 - Tag: DW_TAG_pointer_type
135 Children: DW_CHILDREN_no
137 - Attribute: DW_AT_type
138 Form: DW_FORM_ref_addr
139 - Tag: DW_TAG_variable
140 Children: DW_CHILDREN_no
142 - Attribute: DW_AT_name
144 - Attribute: DW_AT_const_value
146 - Attribute: DW_AT_type
149 - Tag: DW_TAG_compile_unit
150 Children: DW_CHILDREN_yes
152 - Attribute: DW_AT_producer
154 - Attribute: DW_AT_language
156 - Attribute: DW_AT_name
158 - Tag: DW_TAG_pointer_type
159 Children: DW_CHILDREN_no
161 - Attribute: DW_AT_type
162 Form: DW_FORM_ref_addr
163 - Tag: DW_TAG_variable
164 Children: DW_CHILDREN_no
166 - Attribute: DW_AT_name
168 - Attribute: DW_AT_const_value
170 - Attribute: DW_AT_type
173 - Tag: DW_TAG_compile_unit
174 Children: DW_CHILDREN_yes
176 - Attribute: DW_AT_producer
178 - Attribute: DW_AT_language
180 - Attribute: DW_AT_name
182 - Tag: DW_TAG_class_type
183 Children: DW_CHILDREN_no
185 - Attribute: DW_AT_name
187 - Tag: DW_TAG_variable
188 Children: DW_CHILDREN_no
190 - Attribute: DW_AT_name
192 - Attribute: DW_AT_const_value
194 - Attribute: DW_AT_type