| 
 | 1 | +## This test uses TU index for type parsing in dwp and makes sure the DWARF4 type is  | 
 | 2 | +## successfully retrieved.  | 
 | 3 | + | 
 | 4 | +# RUN: llvm-mc %s --split-dwarf-file=test.dwo -filetype obj -triple x86_64 -o test.o  | 
 | 5 | +# RUN: llvm-dwp -e test.o -o test.dwp  | 
 | 6 | +# RUN: llvm-dwarfdump test.dwp | FileCheck %s  | 
 | 7 | + | 
 | 8 | +# Generated from:  | 
 | 9 | +#  | 
 | 10 | +#   struct t1 { };  | 
 | 11 | +#   t1 v1;  | 
 | 12 | +#  | 
 | 13 | +# $ clang++ -S -g -fdebug-types-section -gsplit-dwarf -o test.4.split.dwp.s -gdwarf-4  | 
 | 14 | + | 
 | 15 | +# CHECK: DW_TAG_variable  | 
 | 16 | +# CHECK:   DW_AT_type ({{.*}} "t1")  | 
 | 17 | +	.file	"test.cpp"  | 
 | 18 | +	.section	.debug_types.dwo,"e",@progbits  | 
 | 19 | +	.long	.Ldebug_info_dwo_end0-.Ldebug_info_dwo_start0 # Length of Unit  | 
 | 20 | +.Ldebug_info_dwo_start0:  | 
 | 21 | +	.short	4                               # DWARF version number  | 
 | 22 | +	.long	0                               # Offset Into Abbrev. Section  | 
 | 23 | +	.byte	8                               # Address Size (in bytes)  | 
 | 24 | +	.quad	-4149699470930386446            # Type Signature  | 
 | 25 | +	.long	30                              # Type DIE Offset  | 
 | 26 | +	.byte	1                               # Abbrev [1] 0x17:0xe DW_TAG_type_unit  | 
 | 27 | +	.short	33                              # DW_AT_language  | 
 | 28 | +	.long	0                               # DW_AT_stmt_list  | 
 | 29 | +	.byte	2                               # Abbrev [2] 0x1e:0x6 DW_TAG_structure_type  | 
 | 30 | +	.byte	5                               # DW_AT_calling_convention  | 
 | 31 | +	.byte	1                               # DW_AT_name  | 
 | 32 | +	.byte	1                               # DW_AT_byte_size  | 
 | 33 | +	.byte	1                               # DW_AT_decl_file  | 
 | 34 | +	.byte	1                               # DW_AT_decl_line  | 
 | 35 | +	.byte	0                               # End Of Children Mark  | 
 | 36 | +.Ldebug_info_dwo_end0:  | 
 | 37 | +	.file	1 "." "test.cpp"  | 
 | 38 | +	.type	v1,@object                      # @v1  | 
 | 39 | +	.bss  | 
 | 40 | +	.globl	v1  | 
 | 41 | +v1:  | 
 | 42 | +	.zero	1  | 
 | 43 | +	.size	v1, 1  | 
 | 44 | + | 
 | 45 | +	.section	.debug_abbrev,"",@progbits  | 
 | 46 | +	.byte	1                               # Abbreviation Code  | 
 | 47 | +	.byte	17                              # DW_TAG_compile_unit  | 
 | 48 | +	.byte	0                               # DW_CHILDREN_no  | 
 | 49 | +	.byte	16                              # DW_AT_stmt_list  | 
 | 50 | +	.byte	23                              # DW_FORM_sec_offset  | 
 | 51 | +	.byte	27                              # DW_AT_comp_dir  | 
 | 52 | +	.byte	14                              # DW_FORM_strp  | 
 | 53 | +	.ascii	"\264B"                         # DW_AT_GNU_pubnames  | 
 | 54 | +	.byte	25                              # DW_FORM_flag_present  | 
 | 55 | +	.ascii	"\260B"                         # DW_AT_GNU_dwo_name  | 
 | 56 | +	.byte	14                              # DW_FORM_strp  | 
 | 57 | +	.ascii	"\261B"                         # DW_AT_GNU_dwo_id  | 
 | 58 | +	.byte	7                               # DW_FORM_data8  | 
 | 59 | +	.ascii	"\263B"                         # DW_AT_GNU_addr_base  | 
 | 60 | +	.byte	23                              # DW_FORM_sec_offset  | 
 | 61 | +	.byte	0                               # EOM(1)  | 
 | 62 | +	.byte	0                               # EOM(2)  | 
 | 63 | +	.byte	0                               # EOM(3)  | 
 | 64 | +	.section	.debug_info,"",@progbits  | 
 | 65 | +.Lcu_begin0:  | 
 | 66 | +	.long	.Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit  | 
 | 67 | +.Ldebug_info_start0:  | 
 | 68 | +	.short	4                               # DWARF version number  | 
 | 69 | +	.long	.debug_abbrev                   # Offset Into Abbrev. Section  | 
 | 70 | +	.byte	8                               # Address Size (in bytes)  | 
 | 71 | +	.byte	1                               # Abbrev [1] 0xb:0x19 DW_TAG_compile_unit  | 
 | 72 | +	.long	.Lline_table_start0             # DW_AT_stmt_list  | 
 | 73 | +	.long	.Lskel_string0                  # DW_AT_comp_dir  | 
 | 74 | +                                        # DW_AT_GNU_pubnames  | 
 | 75 | +	.long	.Lskel_string1                  # DW_AT_GNU_dwo_name  | 
 | 76 | +	.quad	1388839634901268525             # DW_AT_GNU_dwo_id  | 
 | 77 | +	.long	.Laddr_table_base0              # DW_AT_GNU_addr_base  | 
 | 78 | +.Ldebug_info_end0:  | 
 | 79 | +	.section	.debug_str,"MS",@progbits,1  | 
 | 80 | +.Lskel_string0:  | 
 | 81 | +	.asciz	"." # string offset=0  | 
 | 82 | +.Lskel_string1:  | 
 | 83 | +	.asciz	"test.dwo"                      # string offset=2  | 
 | 84 | +	.section	.debug_str.dwo,"eMS",@progbits,1  | 
 | 85 | +.Linfo_string0:  | 
 | 86 | +	.asciz	"v1"                            # string offset=0  | 
 | 87 | +.Linfo_string1:  | 
 | 88 | +	.asciz	"t1"                            # string offset=3  | 
 | 89 | +.Linfo_string2:  | 
 | 90 | +	.asciz	"clang version 22.0.0" # string offset=6  | 
 | 91 | +.Linfo_string3:  | 
 | 92 | +	.asciz	"test.cpp"                      # string offset=27  | 
 | 93 | +.Linfo_string4:  | 
 | 94 | +	.asciz	"test.dwo"                      # string offset=36  | 
 | 95 | +	.section	.debug_str_offsets.dwo,"e",@progbits  | 
 | 96 | +	.long	0  | 
 | 97 | +	.long	3  | 
 | 98 | +	.long	6  | 
 | 99 | +	.long	27  | 
 | 100 | +	.long	36  | 
 | 101 | +	.section	.debug_info.dwo,"e",@progbits  | 
 | 102 | +	.long	.Ldebug_info_dwo_end1-.Ldebug_info_dwo_start1 # Length of Unit  | 
 | 103 | +.Ldebug_info_dwo_start1:  | 
 | 104 | +	.short	4                               # DWARF version number  | 
 | 105 | +	.long	0                               # Offset Into Abbrev. Section  | 
 | 106 | +	.byte	8                               # Address Size (in bytes)  | 
 | 107 | +	.byte	3                               # Abbrev [3] 0xb:0x23 DW_TAG_compile_unit  | 
 | 108 | +	.byte	2                               # DW_AT_producer  | 
 | 109 | +	.short	33                              # DW_AT_language  | 
 | 110 | +	.byte	3                               # DW_AT_name  | 
 | 111 | +	.byte	4                               # DW_AT_GNU_dwo_name  | 
 | 112 | +	.quad	1388839634901268525             # DW_AT_GNU_dwo_id  | 
 | 113 | +	.byte	4                               # Abbrev [4] 0x19:0xb DW_TAG_variable  | 
 | 114 | +	.byte	0                               # DW_AT_name  | 
 | 115 | +	.long	36                              # DW_AT_type  | 
 | 116 | +                                        # DW_AT_external  | 
 | 117 | +	.byte	1                               # DW_AT_decl_file  | 
 | 118 | +	.byte	2                               # DW_AT_decl_line  | 
 | 119 | +	.byte	2                               # DW_AT_location  | 
 | 120 | +	.byte	251  | 
 | 121 | +	.byte	0  | 
 | 122 | +	.byte	5                               # Abbrev [5] 0x24:0x9 DW_TAG_structure_type  | 
 | 123 | +                                        # DW_AT_declaration  | 
 | 124 | +	.quad	-4149699470930386446            # DW_AT_signature  | 
 | 125 | +	.byte	0                               # End Of Children Mark  | 
 | 126 | +.Ldebug_info_dwo_end1:  | 
 | 127 | +	.section	.debug_abbrev.dwo,"e",@progbits  | 
 | 128 | +	.byte	1                               # Abbreviation Code  | 
 | 129 | +	.byte	65                              # DW_TAG_type_unit  | 
 | 130 | +	.byte	1                               # DW_CHILDREN_yes  | 
 | 131 | +	.byte	19                              # DW_AT_language  | 
 | 132 | +	.byte	5                               # DW_FORM_data2  | 
 | 133 | +	.byte	16                              # DW_AT_stmt_list  | 
 | 134 | +	.byte	23                              # DW_FORM_sec_offset  | 
 | 135 | +	.byte	0                               # EOM(1)  | 
 | 136 | +	.byte	0                               # EOM(2)  | 
 | 137 | +	.byte	2                               # Abbreviation Code  | 
 | 138 | +	.byte	19                              # DW_TAG_structure_type  | 
 | 139 | +	.byte	0                               # DW_CHILDREN_no  | 
 | 140 | +	.byte	54                              # DW_AT_calling_convention  | 
 | 141 | +	.byte	11                              # DW_FORM_data1  | 
 | 142 | +	.byte	3                               # DW_AT_name  | 
 | 143 | +	.ascii	"\202>"                         # DW_FORM_GNU_str_index  | 
 | 144 | +	.byte	11                              # DW_AT_byte_size  | 
 | 145 | +	.byte	11                              # DW_FORM_data1  | 
 | 146 | +	.byte	58                              # DW_AT_decl_file  | 
 | 147 | +	.byte	11                              # DW_FORM_data1  | 
 | 148 | +	.byte	59                              # DW_AT_decl_line  | 
 | 149 | +	.byte	11                              # DW_FORM_data1  | 
 | 150 | +	.byte	0                               # EOM(1)  | 
 | 151 | +	.byte	0                               # EOM(2)  | 
 | 152 | +	.byte	3                               # Abbreviation Code  | 
 | 153 | +	.byte	17                              # DW_TAG_compile_unit  | 
 | 154 | +	.byte	1                               # DW_CHILDREN_yes  | 
 | 155 | +	.byte	37                              # DW_AT_producer  | 
 | 156 | +	.ascii	"\202>"                         # DW_FORM_GNU_str_index  | 
 | 157 | +	.byte	19                              # DW_AT_language  | 
 | 158 | +	.byte	5                               # DW_FORM_data2  | 
 | 159 | +	.byte	3                               # DW_AT_name  | 
 | 160 | +	.ascii	"\202>"                         # DW_FORM_GNU_str_index  | 
 | 161 | +	.ascii	"\260B"                         # DW_AT_GNU_dwo_name  | 
 | 162 | +	.ascii	"\202>"                         # DW_FORM_GNU_str_index  | 
 | 163 | +	.ascii	"\261B"                         # DW_AT_GNU_dwo_id  | 
 | 164 | +	.byte	7                               # DW_FORM_data8  | 
 | 165 | +	.byte	0                               # EOM(1)  | 
 | 166 | +	.byte	0                               # EOM(2)  | 
 | 167 | +	.byte	4                               # Abbreviation Code  | 
 | 168 | +	.byte	52                              # DW_TAG_variable  | 
 | 169 | +	.byte	0                               # DW_CHILDREN_no  | 
 | 170 | +	.byte	3                               # DW_AT_name  | 
 | 171 | +	.ascii	"\202>"                         # DW_FORM_GNU_str_index  | 
 | 172 | +	.byte	73                              # DW_AT_type  | 
 | 173 | +	.byte	19                              # DW_FORM_ref4  | 
 | 174 | +	.byte	63                              # DW_AT_external  | 
 | 175 | +	.byte	25                              # DW_FORM_flag_present  | 
 | 176 | +	.byte	58                              # DW_AT_decl_file  | 
 | 177 | +	.byte	11                              # DW_FORM_data1  | 
 | 178 | +	.byte	59                              # DW_AT_decl_line  | 
 | 179 | +	.byte	11                              # DW_FORM_data1  | 
 | 180 | +	.byte	2                               # DW_AT_location  | 
 | 181 | +	.byte	24                              # DW_FORM_exprloc  | 
 | 182 | +	.byte	0                               # EOM(1)  | 
 | 183 | +	.byte	0                               # EOM(2)  | 
 | 184 | +	.byte	5                               # Abbreviation Code  | 
 | 185 | +	.byte	19                              # DW_TAG_structure_type  | 
 | 186 | +	.byte	0                               # DW_CHILDREN_no  | 
 | 187 | +	.byte	60                              # DW_AT_declaration  | 
 | 188 | +	.byte	25                              # DW_FORM_flag_present  | 
 | 189 | +	.byte	105                             # DW_AT_signature  | 
 | 190 | +	.byte	32                              # DW_FORM_ref_sig8  | 
 | 191 | +	.byte	0                               # EOM(1)  | 
 | 192 | +	.byte	0                               # EOM(2)  | 
 | 193 | +	.byte	0                               # EOM(3)  | 
 | 194 | +	.section	.debug_line.dwo,"e",@progbits  | 
 | 195 | +.Ltmp0:  | 
 | 196 | +	.long	.Ldebug_line_end0-.Ldebug_line_start0 # unit length  | 
 | 197 | +.Ldebug_line_start0:  | 
 | 198 | +	.short	4  | 
 | 199 | +	.long	.Lprologue_end0-.Lprologue_start0  | 
 | 200 | +.Lprologue_start0:  | 
 | 201 | +	.byte	1  | 
 | 202 | +	.byte	1  | 
 | 203 | +	.byte	1  | 
 | 204 | +	.byte	-5  | 
 | 205 | +	.byte	14  | 
 | 206 | +	.byte	1  | 
 | 207 | +	.byte	0  | 
 | 208 | +	.ascii	"test.cpp"  | 
 | 209 | +	.byte	0  | 
 | 210 | +	.byte	0  | 
 | 211 | +	.byte	0  | 
 | 212 | +	.byte	0  | 
 | 213 | +	.byte	0  | 
 | 214 | +.Lprologue_end0:  | 
 | 215 | +.Ldebug_line_end0:  | 
 | 216 | +	.section	.debug_addr,"",@progbits  | 
 | 217 | +.Laddr_table_base0:  | 
 | 218 | +	.quad	v1  | 
 | 219 | +	.section	.debug_gnu_pubnames,"",@progbits  | 
 | 220 | +	.long	.LpubNames_end0-.LpubNames_start0 # Length of Public Names Info  | 
 | 221 | +.LpubNames_start0:  | 
 | 222 | +	.short	2                               # DWARF Version  | 
 | 223 | +	.long	.Lcu_begin0                     # Offset of Compilation Unit Info  | 
 | 224 | +	.long	36                              # Compilation Unit Length  | 
 | 225 | +	.long	25                              # DIE offset  | 
 | 226 | +	.byte	32                              # Attributes: VARIABLE, EXTERNAL  | 
 | 227 | +	.asciz	"v1"                            # External Name  | 
 | 228 | +	.long	0                               # End Mark  | 
 | 229 | +.LpubNames_end0:  | 
 | 230 | +	.section	.debug_gnu_pubtypes,"",@progbits  | 
 | 231 | +	.long	.LpubTypes_end0-.LpubTypes_start0 # Length of Public Types Info  | 
 | 232 | +.LpubTypes_start0:  | 
 | 233 | +	.short	2                               # DWARF Version  | 
 | 234 | +	.long	.Lcu_begin0                     # Offset of Compilation Unit Info  | 
 | 235 | +	.long	36                              # Compilation Unit Length  | 
 | 236 | +	.long	36                              # DIE offset  | 
 | 237 | +	.byte	16                              # Attributes: TYPE, EXTERNAL  | 
 | 238 | +	.asciz	"t1"                            # External Name  | 
 | 239 | +	.long	0                               # End Mark  | 
 | 240 | +.LpubTypes_end0:  | 
 | 241 | +	.ident	"clang version 22.0.0"  | 
 | 242 | +	.section	".note.GNU-stack","",@progbits  | 
 | 243 | +	.addrsig  | 
 | 244 | +	.section	.debug_line,"",@progbits  | 
 | 245 | +.Lline_table_start0:  | 
0 commit comments