246 lines · plain
1## This test checks output of dsymutil for the incorrect DWARF.2## CU1 has a type which references type in CU2. This referenced3## type references the same type in CU1 back. There is a recursive4## dependence between these two types. dsymutil should report a error,5## remove CU1 and CU2, put only CU3 into the output.6 7# RUN: yaml2obj %s -o %t.o8# RUN: echo '---' > %t2.map9# RUN: echo "triple: 'x86_64-apple-darwin'" >> %t2.map10# RUN: echo 'objects:' >> %t2.map11# RUN: echo " - filename: '%t.o'" >> %t2.map12# RUN: echo ' symbols:' >> %t2.map13# RUN: echo ' - { sym: __Z3foov, objAddr: 0x0, binAddr: 0x10000, size: 0x10 }' >> %t2.map14# RUN: echo '...' >> %t2.map15# RUN: dsymutil --linker parallel -y %t2.map --num-threads 1 -f -o %t1.out 2>&1 \16# RUN: | FileCheck --check-prefix ERROR %s17# RUN: llvm-dwarfdump -a %t1.out | FileCheck %s18 19# ERROR: error: Cann't parse input DWARF. Recursive dependence.20# ERROR: while processing CU121# ERROR: error: Cann't resolve DIE reference22# ERROR: while processing CU223 24# CHECK: file format Mach-O 64-bit x86-6425# CHECK: .debug_info contents:26# CHECK: Compile Unit:27# CHECK: DW_TAG_compile_unit28# CHECK: DW_AT_name{{.*}}"__artificial_type_unit"29# CHECK: 0x[[CLASS1:[0-9a-f]*]]: DW_TAG_class_type{{.*[[:space:]].*}}DW_AT_name{{.*}}"class1"30 31# CHECK: Compile Unit:32# CHECK: DW_TAG_compile_unit33# CHECK-NOT: "CU1"34# CHECK-NOT: "CU2"35# CHECK: DW_AT_name{{.*}}"CU3"36# CHECK-NOT: DW_TAG_class_type37# CHECK: DW_TAG_variable38# CHECK: DW_AT_name{{.*}}"var3"39# CHECK: DW_AT_const_value40# CHECK: DW_AT_type (0x00000000[[CLASS1]]41 42# CHECK-NOT: Compile Unit:43 44--- !mach-o45FileHeader:46 magic: 0xFEEDFACF47 cputype: 0x0100000748 cpusubtype: 0x0000000349 filetype: 0x0000000150 ncmds: 251 sizeofcmds: 37652 flags: 0x0000200053 reserved: 0x0000000054LoadCommands:55 - cmd: LC_SEGMENT_6456 cmdsize: 23257 segname: ''58 vmaddr: 0x0059 vmsize: 0x30060 fileoff: 0x30061 filesize: 0x30062 maxprot: 763 initprot: 764 nsects: 265 flags: 066 Sections:67 - sectname: __debug_abbrev68 segname: __DWARF69 addr: 0x000000000000000F70 size: 0x5a71 offset: 0x0000038072 align: 073 reloff: 0x0000000074 nreloc: 075 flags: 0x0200000076 reserved1: 0x0000000077 reserved2: 0x0000000078 reserved3: 0x0000000079 - sectname: __debug_info80 segname: __DWARF81 addr: 0x00000000000010082 size: 0x8d83 offset: 0x0000041084 align: 085 reloff: 0x0000060086 nreloc: 187 flags: 0x0200000088 reserved1: 0x0000000089 reserved2: 0x0000000090 reserved3: 0x0000000091 relocations:92 - address: 0x1FC93 symbolnum: 194 pcrel: true95 length: 396 extern: true97 type: 098 scattered: false99 value: 0100 - cmd: LC_SYMTAB101 cmdsize: 24102 symoff: 0x700103 nsyms: 2104 stroff: 0x720105 strsize: 10106LinkEditData:107 NameList:108 - n_strx: 1109 n_type: 0x0F110 n_sect: 1111 n_desc: 0112 n_value: 0113 - n_strx: 1114 n_type: 0x0F115 n_sect: 1116 n_desc: 0117 n_value: 0118 StringTable:119 - ''120 - '__Z3foov'121 - ''122DWARF:123 debug_abbrev:124 - Table:125 - Tag: DW_TAG_compile_unit126 Children: DW_CHILDREN_yes127 Attributes:128 - Attribute: DW_AT_producer129 Form: DW_FORM_string130 - Attribute: DW_AT_language131 Form: DW_FORM_data2132 - Attribute: DW_AT_name133 Form: DW_FORM_string134 - Tag: DW_TAG_pointer_type135 Children: DW_CHILDREN_no136 Attributes:137 - Attribute: DW_AT_type138 Form: DW_FORM_ref_addr139 - Tag: DW_TAG_variable140 Children: DW_CHILDREN_no141 Attributes:142 - Attribute: DW_AT_name143 Form: DW_FORM_string144 - Attribute: DW_AT_const_value145 Form: DW_FORM_data4146 - Attribute: DW_AT_type147 Form: DW_FORM_ref4148 - Table:149 - Tag: DW_TAG_compile_unit150 Children: DW_CHILDREN_yes151 Attributes:152 - Attribute: DW_AT_producer153 Form: DW_FORM_string154 - Attribute: DW_AT_language155 Form: DW_FORM_data2156 - Attribute: DW_AT_name157 Form: DW_FORM_string158 - Tag: DW_TAG_pointer_type159 Children: DW_CHILDREN_no160 Attributes:161 - Attribute: DW_AT_type162 Form: DW_FORM_ref_addr163 - Tag: DW_TAG_variable164 Children: DW_CHILDREN_no165 Attributes:166 - Attribute: DW_AT_name167 Form: DW_FORM_string168 - Attribute: DW_AT_const_value169 Form: DW_FORM_data4170 - Attribute: DW_AT_type171 Form: DW_FORM_ref4172 - Table:173 - Tag: DW_TAG_compile_unit174 Children: DW_CHILDREN_yes175 Attributes:176 - Attribute: DW_AT_producer177 Form: DW_FORM_string178 - Attribute: DW_AT_language179 Form: DW_FORM_data2180 - Attribute: DW_AT_name181 Form: DW_FORM_string182 - Tag: DW_TAG_class_type183 Children: DW_CHILDREN_no184 Attributes:185 - Attribute: DW_AT_name186 Form: DW_FORM_string187 - Tag: DW_TAG_variable188 Children: DW_CHILDREN_no189 Attributes:190 - Attribute: DW_AT_name191 Form: DW_FORM_string192 - Attribute: DW_AT_const_value193 Form: DW_FORM_data4194 - Attribute: DW_AT_type195 Form: DW_FORM_ref4196 debug_info:197 - Version: 4198 Entries:199 - AbbrCode: 1200 Values:201 - CStr: by_hand202 - Value: 0x04203 - CStr: CU1204 - AbbrCode: 2205 Values:206 - Value: 0x48207 - AbbrCode: 3208 Values:209 - CStr: var1210 - Value: 0x00000000211 - Value: 0x0000001a212 - AbbrCode: 0213 - Version: 4214 Entries:215 - AbbrCode: 1216 Values:217 - CStr: by_hand218 - Value: 0x04219 - CStr: CU2220 - AbbrCode: 2221 Values:222 - Value: 0x1a223 - AbbrCode: 3224 Values:225 - CStr: var2226 - Value: 0x00000000227 - Value: 0x0000001a228 - AbbrCode: 0229 - Version: 4230 Entries:231 - AbbrCode: 1232 Values:233 - CStr: by_hand234 - Value: 0x04235 - CStr: CU3236 - AbbrCode: 2237 Values:238 - CStr: class1239 - AbbrCode: 3240 Values:241 - CStr: var3242 - Value: 0x00000000243 - Value: 0x0000001a244 - AbbrCode: 0245...246