[llvm-shlib] Fix the version naming style of libLLVM for Windows (#85710)
[llvm-project.git] / bolt / test / X86 / dwarf-handle-visit-loclist-error.s
blobd5ba74fb60166a7453073c08f7737bc143341524
2 # REQUIRES: system-linux
4 # RUN: llvm-mc -dwarf-version=4 -filetype=obj -triple x86_64-unknown-linux %s -o %t1.o
5 # RUN: %clang %cflags -dwarf-4 %t1.o -o %t.exe
6 # RUN: llvm-objcopy --remove-section=.debug_loc %t.exe
7 # RUN: llvm-bolt %t.exe -o %t.bolt --update-debug-sections &> file
8 # RUN: cat file | FileCheck --check-prefix=CHECK %s
10 # Making sure we handle error returned by visitLocationList correctly.
12 # CHECK: BOLT-WARNING: empty location list detected at
13 # CHECK-NEXT: BOLT-WARNING: empty location list detected at
14 # CHECK-NEXT: BOLT:
16 # clang++ main.cpp -g -ffunction-sections -Os -gdwarf-4 -S
17 # int doStuff2(int val) {
18 # return val += 3;
19 # }
21 # int main(int argc, const char** argv) {
22 # return doStuff2(argc);
23 # }
25 .text
26 .file "main.cpp"
27 .section .text._Z8doStuff2i,"ax",@progbits
28 .globl _Z8doStuff2i # -- Begin function _Z8doStuff2i
29 .type _Z8doStuff2i,@function
30 _Z8doStuff2i: # @_Z8doStuff2i
31 .Lfunc_begin0:
32 .file 1 "." "main.cpp"
33 .loc 1 2 0 # main.cpp:2:0
34 .cfi_startproc
35 # %bb.0: # %entry
36 #DEBUG_VALUE: doStuff2:val <- $edi
37 # kill: def $edi killed $edi def $rdi
38 .loc 1 3 14 prologue_end # main.cpp:3:14
39 leal 3(%rdi), %eax
40 .Ltmp0:
41 #DEBUG_VALUE: doStuff2:val <- $eax
42 .loc 1 3 3 is_stmt 0 # main.cpp:3:3
43 retq
44 .Ltmp1:
45 .Lfunc_end0:
46 .size _Z8doStuff2i, .Lfunc_end0-_Z8doStuff2i
47 .cfi_endproc
48 # -- End function
49 .section .text.main,"ax",@progbits
50 .globl main # -- Begin function main
51 .type main,@function
52 main: # @main
53 .Lfunc_begin1:
54 .loc 1 6 0 is_stmt 1 # main.cpp:6:0
55 .cfi_startproc
56 # %bb.0: # %entry
57 #DEBUG_VALUE: main:argc <- $edi
58 #DEBUG_VALUE: main:argv <- $rsi
59 #DEBUG_VALUE: doStuff2:val <- $edi
60 # kill: def $edi killed $edi def $rdi
61 .loc 1 3 14 prologue_end # main.cpp:3:14
62 leal 3(%rdi), %eax
63 .Ltmp2:
64 #DEBUG_VALUE: doStuff2:val <- $eax
65 .loc 1 7 3 # main.cpp:7:3
66 retq
67 .Ltmp3:
68 .Lfunc_end1:
69 .size main, .Lfunc_end1-main
70 .cfi_endproc
71 # -- End function
72 .section .debug_loc,"",@progbits
73 .Ldebug_loc0:
74 .quad -1
75 .quad .Lfunc_begin0 # base address
76 .quad .Lfunc_begin0-.Lfunc_begin0
77 .quad .Ltmp0-.Lfunc_begin0
78 .short 1 # Loc expr size
79 .byte 85 # super-register DW_OP_reg5
80 .quad .Ltmp0-.Lfunc_begin0
81 .quad .Lfunc_end0-.Lfunc_begin0
82 .short 1 # Loc expr size
83 .byte 80 # super-register DW_OP_reg0
84 .quad 0
85 .quad 0
86 .Ldebug_loc1:
87 .quad -1
88 .quad .Lfunc_begin1 # base address
89 .quad .Lfunc_begin1-.Lfunc_begin1
90 .quad .Ltmp2-.Lfunc_begin1
91 .short 1 # Loc expr size
92 .byte 85 # super-register DW_OP_reg5
93 .quad .Ltmp2-.Lfunc_begin1
94 .quad .Lfunc_end1-.Lfunc_begin1
95 .short 1 # Loc expr size
96 .byte 80 # super-register DW_OP_reg0
97 .quad 0
98 .quad 0
99 .section .debug_abbrev,"",@progbits
100 .byte 1 # Abbreviation Code
101 .byte 17 # DW_TAG_compile_unit
102 .byte 1 # DW_CHILDREN_yes
103 .byte 37 # DW_AT_producer
104 .byte 14 # DW_FORM_strp
105 .byte 19 # DW_AT_language
106 .byte 5 # DW_FORM_data2
107 .byte 3 # DW_AT_name
108 .byte 14 # DW_FORM_strp
109 .byte 16 # DW_AT_stmt_list
110 .byte 23 # DW_FORM_sec_offset
111 .byte 27 # DW_AT_comp_dir
112 .byte 14 # DW_FORM_strp
113 .byte 17 # DW_AT_low_pc
114 .byte 1 # DW_FORM_addr
115 .byte 85 # DW_AT_ranges
116 .byte 23 # DW_FORM_sec_offset
117 .byte 0 # EOM(1)
118 .byte 0 # EOM(2)
119 .byte 2 # Abbreviation Code
120 .byte 46 # DW_TAG_subprogram
121 .byte 1 # DW_CHILDREN_yes
122 .byte 17 # DW_AT_low_pc
123 .byte 1 # DW_FORM_addr
124 .byte 18 # DW_AT_high_pc
125 .byte 6 # DW_FORM_data4
126 .byte 64 # DW_AT_frame_base
127 .byte 24 # DW_FORM_exprloc
128 .ascii "\227B" # DW_AT_GNU_all_call_sites
129 .byte 25 # DW_FORM_flag_present
130 .byte 49 # DW_AT_abstract_origin
131 .byte 19 # DW_FORM_ref4
132 .byte 0 # EOM(1)
133 .byte 0 # EOM(2)
134 .byte 3 # Abbreviation Code
135 .byte 5 # DW_TAG_formal_parameter
136 .byte 0 # DW_CHILDREN_no
137 .byte 2 # DW_AT_location
138 .byte 23 # DW_FORM_sec_offset
139 .byte 49 # DW_AT_abstract_origin
140 .byte 19 # DW_FORM_ref4
141 .byte 0 # EOM(1)
142 .byte 0 # EOM(2)
143 .byte 4 # Abbreviation Code
144 .byte 46 # DW_TAG_subprogram
145 .byte 1 # DW_CHILDREN_yes
146 .byte 110 # DW_AT_linkage_name
147 .byte 14 # DW_FORM_strp
148 .byte 3 # DW_AT_name
149 .byte 14 # DW_FORM_strp
150 .byte 58 # DW_AT_decl_file
151 .byte 11 # DW_FORM_data1
152 .byte 59 # DW_AT_decl_line
153 .byte 11 # DW_FORM_data1
154 .byte 73 # DW_AT_type
155 .byte 19 # DW_FORM_ref4
156 .byte 63 # DW_AT_external
157 .byte 25 # DW_FORM_flag_present
158 .byte 32 # DW_AT_inline
159 .byte 11 # DW_FORM_data1
160 .byte 0 # EOM(1)
161 .byte 0 # EOM(2)
162 .byte 5 # Abbreviation Code
163 .byte 5 # DW_TAG_formal_parameter
164 .byte 0 # DW_CHILDREN_no
165 .byte 3 # DW_AT_name
166 .byte 14 # DW_FORM_strp
167 .byte 58 # DW_AT_decl_file
168 .byte 11 # DW_FORM_data1
169 .byte 59 # DW_AT_decl_line
170 .byte 11 # DW_FORM_data1
171 .byte 73 # DW_AT_type
172 .byte 19 # DW_FORM_ref4
173 .byte 0 # EOM(1)
174 .byte 0 # EOM(2)
175 .byte 6 # Abbreviation Code
176 .byte 36 # DW_TAG_base_type
177 .byte 0 # DW_CHILDREN_no
178 .byte 3 # DW_AT_name
179 .byte 14 # DW_FORM_strp
180 .byte 62 # DW_AT_encoding
181 .byte 11 # DW_FORM_data1
182 .byte 11 # DW_AT_byte_size
183 .byte 11 # DW_FORM_data1
184 .byte 0 # EOM(1)
185 .byte 0 # EOM(2)
186 .byte 7 # Abbreviation Code
187 .byte 46 # DW_TAG_subprogram
188 .byte 1 # DW_CHILDREN_yes
189 .byte 17 # DW_AT_low_pc
190 .byte 1 # DW_FORM_addr
191 .byte 18 # DW_AT_high_pc
192 .byte 6 # DW_FORM_data4
193 .byte 64 # DW_AT_frame_base
194 .byte 24 # DW_FORM_exprloc
195 .ascii "\227B" # DW_AT_GNU_all_call_sites
196 .byte 25 # DW_FORM_flag_present
197 .byte 3 # DW_AT_name
198 .byte 14 # DW_FORM_strp
199 .byte 58 # DW_AT_decl_file
200 .byte 11 # DW_FORM_data1
201 .byte 59 # DW_AT_decl_line
202 .byte 11 # DW_FORM_data1
203 .byte 73 # DW_AT_type
204 .byte 19 # DW_FORM_ref4
205 .byte 63 # DW_AT_external
206 .byte 25 # DW_FORM_flag_present
207 .byte 0 # EOM(1)
208 .byte 0 # EOM(2)
209 .byte 8 # Abbreviation Code
210 .byte 5 # DW_TAG_formal_parameter
211 .byte 0 # DW_CHILDREN_no
212 .byte 2 # DW_AT_location
213 .byte 24 # DW_FORM_exprloc
214 .byte 3 # DW_AT_name
215 .byte 14 # DW_FORM_strp
216 .byte 58 # DW_AT_decl_file
217 .byte 11 # DW_FORM_data1
218 .byte 59 # DW_AT_decl_line
219 .byte 11 # DW_FORM_data1
220 .byte 73 # DW_AT_type
221 .byte 19 # DW_FORM_ref4
222 .byte 0 # EOM(1)
223 .byte 0 # EOM(2)
224 .byte 9 # Abbreviation Code
225 .byte 29 # DW_TAG_inlined_subroutine
226 .byte 1 # DW_CHILDREN_yes
227 .byte 49 # DW_AT_abstract_origin
228 .byte 19 # DW_FORM_ref4
229 .byte 17 # DW_AT_low_pc
230 .byte 1 # DW_FORM_addr
231 .byte 18 # DW_AT_high_pc
232 .byte 6 # DW_FORM_data4
233 .byte 88 # DW_AT_call_file
234 .byte 11 # DW_FORM_data1
235 .byte 89 # DW_AT_call_line
236 .byte 11 # DW_FORM_data1
237 .byte 87 # DW_AT_call_column
238 .byte 11 # DW_FORM_data1
239 .byte 0 # EOM(1)
240 .byte 0 # EOM(2)
241 .byte 10 # Abbreviation Code
242 .byte 15 # DW_TAG_pointer_type
243 .byte 0 # DW_CHILDREN_no
244 .byte 73 # DW_AT_type
245 .byte 19 # DW_FORM_ref4
246 .byte 0 # EOM(1)
247 .byte 0 # EOM(2)
248 .byte 11 # Abbreviation Code
249 .byte 38 # DW_TAG_const_type
250 .byte 0 # DW_CHILDREN_no
251 .byte 73 # DW_AT_type
252 .byte 19 # DW_FORM_ref4
253 .byte 0 # EOM(1)
254 .byte 0 # EOM(2)
255 .byte 0 # EOM(3)
256 .section .debug_info,"",@progbits
257 .Lcu_begin0:
258 .long .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit
259 .Ldebug_info_start0:
260 .short 4 # DWARF version number
261 .long .debug_abbrev # Offset Into Abbrev. Section
262 .byte 8 # Address Size (in bytes)
263 .byte 1 # Abbrev [1] 0xb:0xc8 DW_TAG_compile_unit
264 .long .Linfo_string0 # DW_AT_producer
265 .short 33 # DW_AT_language
266 .long .Linfo_string1 # DW_AT_name
267 .long .Lline_table_start0 # DW_AT_stmt_list
268 .long .Linfo_string2 # DW_AT_comp_dir
269 .quad 0 # DW_AT_low_pc
270 .long .Ldebug_ranges0 # DW_AT_ranges
271 .byte 2 # Abbrev [2] 0x2a:0x1d DW_TAG_subprogram
272 .quad .Lfunc_begin0 # DW_AT_low_pc
273 .long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc
274 .byte 1 # DW_AT_frame_base
275 .byte 87
276 # DW_AT_GNU_all_call_sites
277 .long 71 # DW_AT_abstract_origin
278 .byte 3 # Abbrev [3] 0x3d:0x9 DW_TAG_formal_parameter
279 .long .Ldebug_loc0 # DW_AT_location
280 .long 87 # DW_AT_abstract_origin
281 .byte 0 # End Of Children Mark
282 .byte 4 # Abbrev [4] 0x47:0x1c DW_TAG_subprogram
283 .long .Linfo_string3 # DW_AT_linkage_name
284 .long .Linfo_string4 # DW_AT_name
285 .byte 1 # DW_AT_decl_file
286 .byte 2 # DW_AT_decl_line
287 .long 99 # DW_AT_type
288 # DW_AT_external
289 .byte 1 # DW_AT_inline
290 .byte 5 # Abbrev [5] 0x57:0xb DW_TAG_formal_parameter
291 .long .Linfo_string6 # DW_AT_name
292 .byte 1 # DW_AT_decl_file
293 .byte 2 # DW_AT_decl_line
294 .long 99 # DW_AT_type
295 .byte 0 # End Of Children Mark
296 .byte 6 # Abbrev [6] 0x63:0x7 DW_TAG_base_type
297 .long .Linfo_string5 # DW_AT_name
298 .byte 5 # DW_AT_encoding
299 .byte 4 # DW_AT_byte_size
300 .byte 7 # Abbrev [7] 0x6a:0x52 DW_TAG_subprogram
301 .quad .Lfunc_begin1 # DW_AT_low_pc
302 .long .Lfunc_end1-.Lfunc_begin1 # DW_AT_high_pc
303 .byte 1 # DW_AT_frame_base
304 .byte 87
305 # DW_AT_GNU_all_call_sites
306 .long .Linfo_string7 # DW_AT_name
307 .byte 1 # DW_AT_decl_file
308 .byte 6 # DW_AT_decl_line
309 .long 99 # DW_AT_type
310 # DW_AT_external
311 .byte 8 # Abbrev [8] 0x83:0xd DW_TAG_formal_parameter
312 .byte 1 # DW_AT_location
313 .byte 85
314 .long .Linfo_string8 # DW_AT_name
315 .byte 1 # DW_AT_decl_file
316 .byte 6 # DW_AT_decl_line
317 .long 99 # DW_AT_type
318 .byte 8 # Abbrev [8] 0x90:0xd DW_TAG_formal_parameter
319 .byte 1 # DW_AT_location
320 .byte 84
321 .long .Linfo_string9 # DW_AT_name
322 .byte 1 # DW_AT_decl_file
323 .byte 6 # DW_AT_decl_line
324 .long 188 # DW_AT_type
325 .byte 9 # Abbrev [9] 0x9d:0x1e DW_TAG_inlined_subroutine
326 .long 71 # DW_AT_abstract_origin
327 .quad .Lfunc_begin1 # DW_AT_low_pc
328 .long .Ltmp2-.Lfunc_begin1 # DW_AT_high_pc
329 .byte 1 # DW_AT_call_file
330 .byte 7 # DW_AT_call_line
331 .byte 10 # DW_AT_call_column
332 .byte 3 # Abbrev [3] 0xb1:0x9 DW_TAG_formal_parameter
333 .long .Ldebug_loc1 # DW_AT_location
334 .long 87 # DW_AT_abstract_origin
335 .byte 0 # End Of Children Mark
336 .byte 0 # End Of Children Mark
337 .byte 10 # Abbrev [10] 0xbc:0x5 DW_TAG_pointer_type
338 .long 193 # DW_AT_type
339 .byte 10 # Abbrev [10] 0xc1:0x5 DW_TAG_pointer_type
340 .long 198 # DW_AT_type
341 .byte 11 # Abbrev [11] 0xc6:0x5 DW_TAG_const_type
342 .long 203 # DW_AT_type
343 .byte 6 # Abbrev [6] 0xcb:0x7 DW_TAG_base_type
344 .long .Linfo_string10 # DW_AT_name
345 .byte 6 # DW_AT_encoding
346 .byte 1 # DW_AT_byte_size
347 .byte 0 # End Of Children Mark
348 .Ldebug_info_end0:
349 .section .debug_ranges,"",@progbits
350 .Ldebug_ranges0:
351 .quad .Lfunc_begin0
352 .quad .Lfunc_end0
353 .quad .Lfunc_begin1
354 .quad .Lfunc_end1
355 .quad 0
356 .quad 0
357 .section .debug_str,"MS",@progbits,1
358 .Linfo_string0:
359 .asciz "clang version 15.0.0" # string offset=0
360 .Linfo_string1:
361 .asciz "main.cpp" # string offset=134
362 .Linfo_string2:
363 .asciz "." # string offset=143
364 .Linfo_string3:
365 .asciz "_Z8doStuff2i" # string offset=181
366 .Linfo_string4:
367 .asciz "doStuff2" # string offset=194
368 .Linfo_string5:
369 .asciz "int" # string offset=203
370 .Linfo_string6:
371 .asciz "val" # string offset=207
372 .Linfo_string7:
373 .asciz "main" # string offset=211
374 .Linfo_string8:
375 .asciz "argc" # string offset=216
376 .Linfo_string9:
377 .asciz "argv" # string offset=221
378 .Linfo_string10:
379 .asciz "char" # string offset=226
380 .ident "clang version 15.0.0"
381 .section ".note.GNU-stack","",@progbits
382 .addrsig
383 .section .debug_line,"",@progbits
384 .Lline_table_start0: