201 lines · plain
1## This test checks debug info for the types located into the2## different compilation units from the single object file.3## Type definition for the "class1" should be removed from the4## second compilation unit.5 6# RUN: yaml2obj %s -o %t.o7# RUN: echo '---' > %t2.map8# RUN: echo "triple: 'x86_64-apple-darwin'" >> %t2.map9# RUN: echo 'objects:' >> %t2.map10# RUN: echo " - filename: '%t.o'" >> %t2.map11# RUN: echo ' symbols:' >> %t2.map12# RUN: echo ' - { sym: __Z3foov, objAddr: 0x0, binAddr: 0x10000, size: 0x10 }' >> %t2.map13# RUN: echo '...' >> %t2.map14# RUN: dsymutil -y %t2.map -f -o - | llvm-dwarfdump -a - | FileCheck %s15 16# CHECK: file format Mach-O 64-bit x86-6417# CHECK: .debug_info contents:18# CHECK: Compile Unit:19# CHECK: DW_TAG_compile_unit20# CHECK: DW_AT_name{{.*}}"CU1"21# CHECK: DW_TAG_class_type{{.*[[:space:]].*}}DW_AT_name{{.*}}"class1"22# CHECK: DW_TAG_variable23# CHECK: DW_AT_name{{.*}}"var1"24# CHECK: DW_AT_const_value25# CHECK: DW_AT_type (0x00000000[[CLASS1:[0-9a-f]*]]26 27# CHECK: Compile Unit:28# CHECK: DW_TAG_compile_unit29# CHECK: DW_AT_name{{.*}}"CU2"30# CHECK-NOT: DW_TAG_class_type31# CHECK-NOT: "class1"32# CHECK: DW_TAG_variable33# CHECK: DW_AT_name{{.*}}"var2"34# CHECK: DW_AT_const_value35# CHECK: DW_AT_type (0x00000000[[CLASS1]]36 37 38 39--- !mach-o40FileHeader:41 magic: 0xFEEDFACF42 cputype: 0x0100000743 cpusubtype: 0x0000000344 filetype: 0x0000000145 ncmds: 246 sizeofcmds: 37647 flags: 0x0000200048 reserved: 0x0000000049LoadCommands:50 - cmd: LC_SEGMENT_6451 cmdsize: 23252 segname: ''53 vmaddr: 0x0054 vmsize: 0x30055 fileoff: 0x30056 filesize: 0x30057 maxprot: 758 initprot: 759 nsects: 260 flags: 061 Sections:62 - sectname: __debug_abbrev63 segname: __DWARF64 addr: 0x000000000000000F65 size: 0x3c66 offset: 0x0000038067 align: 068 reloff: 0x0000000069 nreloc: 070 flags: 0x0200000071 reserved1: 0x0000000072 reserved2: 0x0000000073 reserved3: 0x0000000074 - sectname: __debug_info75 segname: __DWARF76 addr: 0x00000000000010077 size: 0x6278 offset: 0x0000041079 align: 080 reloff: 0x0000060081 nreloc: 182 flags: 0x0200000083 reserved1: 0x0000000084 reserved2: 0x0000000085 reserved3: 0x0000000086 relocations:87 - address: 0x1FC88 symbolnum: 189 pcrel: true90 length: 391 extern: true92 type: 093 scattered: false94 value: 095 - cmd: LC_SYMTAB96 cmdsize: 2497 symoff: 0x70098 nsyms: 299 stroff: 0x720100 strsize: 10101LinkEditData:102 NameList:103 - n_strx: 1104 n_type: 0x0F105 n_sect: 1106 n_desc: 0107 n_value: 0108 - n_strx: 1109 n_type: 0x0F110 n_sect: 1111 n_desc: 0112 n_value: 0113 StringTable:114 - ''115 - '__Z3foov'116 - ''117DWARF:118 debug_abbrev:119 - Table:120 - Tag: DW_TAG_compile_unit121 Children: DW_CHILDREN_yes122 Attributes:123 - Attribute: DW_AT_producer124 Form: DW_FORM_string125 - Attribute: DW_AT_language126 Form: DW_FORM_data2127 - Attribute: DW_AT_name128 Form: DW_FORM_string129 - Tag: DW_TAG_class_type130 Children: DW_CHILDREN_no131 Attributes:132 - Attribute: DW_AT_name133 Form: DW_FORM_string134 - Tag: DW_TAG_variable135 Children: DW_CHILDREN_no136 Attributes:137 - Attribute: DW_AT_name138 Form: DW_FORM_string139 - Attribute: DW_AT_const_value140 Form: DW_FORM_data4141 - Attribute: DW_AT_type142 Form: DW_FORM_ref4143 - Table:144 - Tag: DW_TAG_compile_unit145 Children: DW_CHILDREN_yes146 Attributes:147 - Attribute: DW_AT_producer148 Form: DW_FORM_string149 - Attribute: DW_AT_language150 Form: DW_FORM_data2151 - Attribute: DW_AT_name152 Form: DW_FORM_string153 - Tag: DW_TAG_class_type154 Children: DW_CHILDREN_no155 Attributes:156 - Attribute: DW_AT_name157 Form: DW_FORM_string158 - Tag: DW_TAG_variable159 Children: DW_CHILDREN_no160 Attributes:161 - Attribute: DW_AT_name162 Form: DW_FORM_string163 - Attribute: DW_AT_const_value164 Form: DW_FORM_data4165 - Attribute: DW_AT_type166 Form: DW_FORM_ref4167 debug_info:168 - Version: 4169 Entries:170 - AbbrCode: 1171 Values:172 - CStr: by_hand173 - Value: 0x04174 - CStr: CU1175 - AbbrCode: 2176 Values:177 - CStr: class1178 - AbbrCode: 3179 Values:180 - CStr: var1181 - Value: 0x00000000182 - Value: 0x0000001a183 - AbbrCode: 0184 - Version: 4185 Entries:186 - AbbrCode: 1187 Values:188 - CStr: by_hand189 - Value: 0x04190 - CStr: CU2191 - AbbrCode: 2192 Values:193 - CStr: class1194 - AbbrCode: 3195 Values:196 - CStr: var2197 - Value: 0x00000000198 - Value: 0x0000001a199 - AbbrCode: 0200...201