306 lines · plain
1// Test dwarf-5 DW_AT_location [DW_FORM_loclistx].2 3// Built with "clang -c -target aarch64-linux -gdwarf-5 -O3 -S" from the following source:4// void use(int *);5// void f(void) {6// int x = 1;7// use(&x);8// }9 10// RUN: llvm-mc -filetype=obj -triple=aarch64-linux-android --dwarf-version=5 -o %t.o %s11// RUN: echo 'FRAME %t.o 0x4' | llvm-symbolizer | FileCheck %s12 13// DW_AT_location (indexed (0x0) loclist = 0x00000010:14// [0x0000000000000010, 0x0000000000000018): DW_OP_consts +1, DW_OP_stack_value15// [0x0000000000000018, 0x0000000000000028): DW_OP_breg29 W29-4)16// CHECK: f17// CHECK-NEXT: x18// CHECK-NEXT: {{.*}}dbg.c:319// CHECK-NEXT: -4 4 ??20 21 .text22 .file "dbg.c"23 .file 0 "/code/build-llvm-cmake" "/tmp/dbg.c" md5 0x87e53f5ae1de5f2c6ec0baa7fe68319224 .globl _Z1fv // -- Begin function _Z1fv25 .p2align 226 .type _Z1fv,@function27_Z1fv: // @_Z1fv28.Lfunc_begin0:29 .loc 0 2 0 // /tmp/dbg.c:2:030 .cfi_startproc31// %bb.0: // %entry32 sub sp, sp, #32 // =3233 stp x29, x30, [sp, #16] // 16-byte Folded Spill34 add x29, sp, #16 // =1635 .cfi_def_cfa w29, 1636 .cfi_offset w30, -837 .cfi_offset w29, -1638 mov w8, #139.Ltmp0:40 //DEBUG_VALUE: f:x <- 141 .loc 0 4 3 prologue_end // /tmp/dbg.c:4:342 sub x0, x29, #4 // =443 .loc 0 3 7 // /tmp/dbg.c:3:744 stur w8, [x29, #-4]45.Ltmp1:46 //DEBUG_VALUE: f:x <- [DW_OP_constu 4, DW_OP_minus, DW_OP_deref] $fp47 .loc 0 4 3 // /tmp/dbg.c:4:348 bl _Z3usePi49.Ltmp2:50 .loc 0 5 1 // /tmp/dbg.c:5:151 ldp x29, x30, [sp, #16] // 16-byte Folded Reload52 add sp, sp, #32 // =3253 ret54.Ltmp3:55.Lfunc_end0:56 .size _Z1fv, .Lfunc_end0-_Z1fv57 .cfi_endproc58 // -- End function59 .section .debug_str_offsets,"",@progbits60 .word 4061 .hword 562 .hword 063.Lstr_offsets_base0:64 .section .debug_str,"MS",@progbits,165.Linfo_string0:66 .asciz "clang version 10.0.0 (git@github.com:llvm/llvm-project.git 0a094679914ccea0f9c8f03165132172544d9799)" // string offset=067.Linfo_string1:68 .asciz "/tmp/dbg.c" // string offset=10169.Linfo_string2:70 .asciz "/code/build-llvm-cmake" // string offset=11271.Linfo_string3:72 .asciz "_Z3usePi" // string offset=13573.Linfo_string4:74 .asciz "use" // string offset=14475.Linfo_string5:76 .asciz "int" // string offset=14877.Linfo_string6:78 .asciz "_Z1fv" // string offset=15279.Linfo_string7:80 .asciz "f" // string offset=15881.Linfo_string8:82 .asciz "x" // string offset=16083 .section .debug_str_offsets,"",@progbits84 .word .Linfo_string085 .word .Linfo_string186 .word .Linfo_string287 .word .Linfo_string388 .word .Linfo_string489 .word .Linfo_string590 .word .Linfo_string691 .word .Linfo_string792 .word .Linfo_string893 .section .debug_loclists,"",@progbits94 .word .Ldebug_loclist_table_end0-.Ldebug_loclist_table_start0 // Length95.Ldebug_loclist_table_start0:96 .hword 5 // Version97 .byte 8 // Address size98 .byte 0 // Segment selector size99 .word 1 // Offset entry count100.Lloclists_table_base0:101 .word .Ldebug_loc0-.Lloclists_table_base0102.Ldebug_loc0:103 .byte 4 // DW_LLE_offset_pair104 .uleb128 .Ltmp0-.Lfunc_begin0 // starting offset105 .uleb128 .Ltmp1-.Lfunc_begin0 // ending offset106 .byte 3 // Loc expr size107 .byte 17 // DW_OP_consts108 .byte 1 // 1109 .byte 159 // DW_OP_stack_value110 .byte 4 // DW_LLE_offset_pair111 .uleb128 .Ltmp1-.Lfunc_begin0 // starting offset112 .uleb128 .Lfunc_end0-.Lfunc_begin0 // ending offset113 .byte 2 // Loc expr size114 .byte 141 // DW_OP_breg29115 .byte 124 // -4116 .byte 0 // DW_LLE_end_of_list117.Ldebug_loclist_table_end0:118 .section .debug_abbrev,"",@progbits119 .byte 1 // Abbreviation Code120 .byte 17 // DW_TAG_compile_unit121 .byte 1 // DW_CHILDREN_yes122 .byte 37 // DW_AT_producer123 .byte 37 // DW_FORM_strx1124 .byte 19 // DW_AT_language125 .byte 5 // DW_FORM_data2126 .byte 3 // DW_AT_name127 .byte 37 // DW_FORM_strx1128 .byte 114 // DW_AT_str_offsets_base129 .byte 23 // DW_FORM_sec_offset130 .byte 16 // DW_AT_stmt_list131 .byte 23 // DW_FORM_sec_offset132 .byte 27 // DW_AT_comp_dir133 .byte 37 // DW_FORM_strx1134 .byte 17 // DW_AT_low_pc135 .byte 27 // DW_FORM_addrx136 .byte 18 // DW_AT_high_pc137 .byte 6 // DW_FORM_data4138 .byte 115 // DW_AT_addr_base139 .byte 23 // DW_FORM_sec_offset140 .ascii "\214\001" // DW_AT_loclists_base141 .byte 23 // DW_FORM_sec_offset142 .byte 0 // EOM(1)143 .byte 0 // EOM(2)144 .byte 2 // Abbreviation Code145 .byte 46 // DW_TAG_subprogram146 .byte 1 // DW_CHILDREN_yes147 .byte 110 // DW_AT_linkage_name148 .byte 37 // DW_FORM_strx1149 .byte 3 // DW_AT_name150 .byte 37 // DW_FORM_strx1151 .byte 58 // DW_AT_decl_file152 .byte 11 // DW_FORM_data1153 .byte 59 // DW_AT_decl_line154 .byte 11 // DW_FORM_data1155 .byte 60 // DW_AT_declaration156 .byte 25 // DW_FORM_flag_present157 .byte 63 // DW_AT_external158 .byte 25 // DW_FORM_flag_present159 .byte 0 // EOM(1)160 .byte 0 // EOM(2)161 .byte 3 // Abbreviation Code162 .byte 5 // DW_TAG_formal_parameter163 .byte 0 // DW_CHILDREN_no164 .byte 73 // DW_AT_type165 .byte 19 // DW_FORM_ref4166 .byte 0 // EOM(1)167 .byte 0 // EOM(2)168 .byte 4 // Abbreviation Code169 .byte 15 // DW_TAG_pointer_type170 .byte 0 // DW_CHILDREN_no171 .byte 73 // DW_AT_type172 .byte 19 // DW_FORM_ref4173 .byte 0 // EOM(1)174 .byte 0 // EOM(2)175 .byte 5 // Abbreviation Code176 .byte 36 // DW_TAG_base_type177 .byte 0 // DW_CHILDREN_no178 .byte 3 // DW_AT_name179 .byte 37 // DW_FORM_strx1180 .byte 62 // DW_AT_encoding181 .byte 11 // DW_FORM_data1182 .byte 11 // DW_AT_byte_size183 .byte 11 // DW_FORM_data1184 .byte 0 // EOM(1)185 .byte 0 // EOM(2)186 .byte 6 // Abbreviation Code187 .byte 46 // DW_TAG_subprogram188 .byte 1 // DW_CHILDREN_yes189 .byte 17 // DW_AT_low_pc190 .byte 27 // DW_FORM_addrx191 .byte 18 // DW_AT_high_pc192 .byte 6 // DW_FORM_data4193 .byte 64 // DW_AT_frame_base194 .byte 24 // DW_FORM_exprloc195 .byte 122 // DW_AT_call_all_calls196 .byte 25 // DW_FORM_flag_present197 .byte 110 // DW_AT_linkage_name198 .byte 37 // DW_FORM_strx1199 .byte 3 // DW_AT_name200 .byte 37 // DW_FORM_strx1201 .byte 58 // DW_AT_decl_file202 .byte 11 // DW_FORM_data1203 .byte 59 // DW_AT_decl_line204 .byte 11 // DW_FORM_data1205 .byte 63 // DW_AT_external206 .byte 25 // DW_FORM_flag_present207 .byte 0 // EOM(1)208 .byte 0 // EOM(2)209 .byte 7 // Abbreviation Code210 .byte 52 // DW_TAG_variable211 .byte 0 // DW_CHILDREN_no212 .byte 2 // DW_AT_location213 .byte 34 // DW_FORM_loclistx214 .byte 3 // DW_AT_name215 .byte 37 // DW_FORM_strx1216 .byte 58 // DW_AT_decl_file217 .byte 11 // DW_FORM_data1218 .byte 59 // DW_AT_decl_line219 .byte 11 // DW_FORM_data1220 .byte 73 // DW_AT_type221 .byte 19 // DW_FORM_ref4222 .byte 0 // EOM(1)223 .byte 0 // EOM(2)224 .byte 8 // Abbreviation Code225 .byte 72 // DW_TAG_call_site226 .byte 0 // DW_CHILDREN_no227 .byte 127 // DW_AT_call_origin228 .byte 19 // DW_FORM_ref4229 .byte 125 // DW_AT_call_return_pc230 .byte 1 // DW_FORM_addr231 .byte 0 // EOM(1)232 .byte 0 // EOM(2)233 .byte 0 // EOM(3)234 .section .debug_info,"",@progbits235.Lcu_begin0:236 .word .Ldebug_info_end0-.Ldebug_info_start0 // Length of Unit237.Ldebug_info_start0:238 .hword 5 // DWARF version number239 .byte 1 // DWARF Unit Type240 .byte 8 // Address Size (in bytes)241 .word .debug_abbrev // Offset Into Abbrev. Section242 .byte 1 // Abbrev [1] 0xc:0x53 DW_TAG_compile_unit243 .byte 0 // DW_AT_producer244 .hword 33 // DW_AT_language245 .byte 1 // DW_AT_name246 .word .Lstr_offsets_base0 // DW_AT_str_offsets_base247 .word .Lline_table_start0 // DW_AT_stmt_list248 .byte 2 // DW_AT_comp_dir249 .byte 0 // DW_AT_low_pc250 .word .Lfunc_end0-.Lfunc_begin0 // DW_AT_high_pc251 .word .Laddr_table_base0 // DW_AT_addr_base252 .word .Lloclists_table_base0 // DW_AT_loclists_base253 .byte 2 // Abbrev [2] 0x27:0xb DW_TAG_subprogram254 .byte 3 // DW_AT_linkage_name255 .byte 4 // DW_AT_name256 .byte 0 // DW_AT_decl_file257 .byte 1 // DW_AT_decl_line258 // DW_AT_declaration259 // DW_AT_external260 .byte 3 // Abbrev [3] 0x2c:0x5 DW_TAG_formal_parameter261 .word 50 // DW_AT_type262 .byte 0 // End Of Children Mark263 .byte 4 // Abbrev [4] 0x32:0x5 DW_TAG_pointer_type264 .word 55 // DW_AT_type265 .byte 5 // Abbrev [5] 0x37:0x4 DW_TAG_base_type266 .byte 5 // DW_AT_name267 .byte 5 // DW_AT_encoding268 .byte 4 // DW_AT_byte_size269 .byte 6 // Abbrev [6] 0x3b:0x23 DW_TAG_subprogram270 .byte 0 // DW_AT_low_pc271 .word .Lfunc_end0-.Lfunc_begin0 // DW_AT_high_pc272 .byte 1 // DW_AT_frame_base273 .byte 109274 // DW_AT_call_all_calls275 .byte 6 // DW_AT_linkage_name276 .byte 7 // DW_AT_name277 .byte 0 // DW_AT_decl_file278 .byte 2 // DW_AT_decl_line279 // DW_AT_external280 .byte 7 // Abbrev [7] 0x47:0x9 DW_TAG_variable281 .byte 0 // DW_AT_location282 .byte 8 // DW_AT_name283 .byte 0 // DW_AT_decl_file284 .byte 3 // DW_AT_decl_line285 .word 55 // DW_AT_type286 .byte 8 // Abbrev [8] 0x50:0xd DW_TAG_call_site287 .word 39 // DW_AT_call_origin288 .xword .Ltmp2-.Lfunc_begin0 // DW_AT_call_return_pc289 .byte 0 // End Of Children Mark290 .byte 0 // End Of Children Mark291.Ldebug_info_end0:292 .section .debug_addr,"",@progbits293 .word .Ldebug_addr_end0-.Ldebug_addr_start0 // Length of contribution294.Ldebug_addr_start0:295 .hword 5 // DWARF version number296 .byte 8 // Address size297 .byte 0 // Segment selector size298.Laddr_table_base0:299 .xword .Lfunc_begin0300.Ldebug_addr_end0:301 .ident "clang version 10.0.0 (git@github.com:llvm/llvm-project.git 0a094679914ccea0f9c8f03165132172544d9799)"302 .section ".note.GNU-stack","",@progbits303 .addrsig304 .section .debug_line,"",@progbits305.Lline_table_start0:306