xref: /llvm-project/bolt/test/X86/Inputs/dwarf5-do-no-convert-low-pc-high-pc-to-ranges.s (revision 75f770a68f70498f0b5229597f70dd8204c66e7c)
1# -g2 -gdwarf-4 main.cpp -O1
2# static int helper(int i) {
3#   return ++i;
4# }
5# void may_not_exist(void) __attribute__ ((weak));
6# int main(int argc, char *argv[]) {
7#   if (may_not_exist)
8#     may_not_exist();
9#   int j = 0;
10#   [[clang::always_inline]] j = helper(argc);
11#   return j;
12# }
13
14	.text
15	.file	"main.cpp"
16	.globl	main                            # -- Begin function main
17	.p2align	4, 0x90
18	.type	main,@function
19main:                                   # @main
20.Lfunc_begin0:
21	.file	0 "." "main.cpp" md5 0x375df0e93c6d762413bfe2708333ecaf
22	.loc	0 5 0                           # main.cpp:5:0
23	.cfi_startproc
24# %bb.0:                                # %entry
25	#DEBUG_VALUE: main:argc <- $edi
26	#DEBUG_VALUE: main:argv <- $rsi
27	pushq	%rbx
28	.cfi_def_cfa_offset 16
29	.cfi_offset %rbx, -16
30	movl	%edi, %ebx
31.Ltmp0:
32	.loc	0 6 7 prologue_end              # main.cpp:6:7
33	cmpq	$0, _Z13may_not_existv@GOTPCREL(%rip)
34	je	.LBB0_2
35.Ltmp1:
36# %bb.1:                                # %if.then
37	#DEBUG_VALUE: main:argc <- $ebx
38	#DEBUG_VALUE: main:argv <- $rsi
39	.loc	0 7 5                           # main.cpp:7:5
40	callq	_Z13may_not_existv@PLT
41.Ltmp2:
42	#DEBUG_VALUE: main:argv <- [DW_OP_LLVM_entry_value 1] $rsi
43.LBB0_2:                                # %if.end
44	#DEBUG_VALUE: main:argc <- $ebx
45	#DEBUG_VALUE: main:argv <- [DW_OP_LLVM_entry_value 1] $rsi
46	#DEBUG_VALUE: main:j <- 0
47	#DEBUG_VALUE: helper:i <- $ebx
48	.loc	0 2 10                          # main.cpp:2:10
49	incl	%ebx
50.Ltmp3:
51	#DEBUG_VALUE: main:argc <- [DW_OP_LLVM_entry_value 1] $edi
52	#DEBUG_VALUE: helper:i <- $ebx
53	#DEBUG_VALUE: main:j <- $ebx
54	.loc	0 10 3                          # main.cpp:10:3
55	movl	%ebx, %eax
56	.loc	0 10 3 epilogue_begin is_stmt 0 # main.cpp:10:3
57	popq	%rbx
58.Ltmp4:
59	#DEBUG_VALUE: helper:i <- $eax
60	#DEBUG_VALUE: main:j <- $eax
61	.cfi_def_cfa_offset 8
62	retq
63.Ltmp5:
64.Lfunc_end0:
65	.size	main, .Lfunc_end0-main
66	.cfi_endproc
67                                        # -- End function
68	.section	.debug_loclists,"",@progbits
69	.long	.Ldebug_list_header_end0-.Ldebug_list_header_start0 # Length
70.Ldebug_list_header_start0:
71	.short	5                               # Version
72	.byte	8                               # Address size
73	.byte	0                               # Segment selector size
74	.long	3                               # Offset entry count
75.Lloclists_table_base0:
76	.long	.Ldebug_loc0-.Lloclists_table_base0
77	.long	.Ldebug_loc1-.Lloclists_table_base0
78	.long	.Ldebug_loc2-.Lloclists_table_base0
79.Ldebug_loc0:
80	.byte	4                               # DW_LLE_offset_pair
81	.uleb128 .Lfunc_begin0-.Lfunc_begin0    #   starting offset
82	.uleb128 .Ltmp1-.Lfunc_begin0           #   ending offset
83	.byte	1                               # Loc expr size
84	.byte	85                              # super-register DW_OP_reg5
85	.byte	4                               # DW_LLE_offset_pair
86	.uleb128 .Ltmp1-.Lfunc_begin0           #   starting offset
87	.uleb128 .Ltmp3-.Lfunc_begin0           #   ending offset
88	.byte	1                               # Loc expr size
89	.byte	83                              # super-register DW_OP_reg3
90	.byte	4                               # DW_LLE_offset_pair
91	.uleb128 .Ltmp3-.Lfunc_begin0           #   starting offset
92	.uleb128 .Lfunc_end0-.Lfunc_begin0      #   ending offset
93	.byte	4                               # Loc expr size
94	.byte	163                             # DW_OP_entry_value
95	.byte	1                               # 1
96	.byte	85                              # super-register DW_OP_reg5
97	.byte	159                             # DW_OP_stack_value
98	.byte	0                               # DW_LLE_end_of_list
99.Ldebug_loc1:
100	.byte	4                               # DW_LLE_offset_pair
101	.uleb128 .Lfunc_begin0-.Lfunc_begin0    #   starting offset
102	.uleb128 .Ltmp2-.Lfunc_begin0           #   ending offset
103	.byte	1                               # Loc expr size
104	.byte	84                              # DW_OP_reg4
105	.byte	4                               # DW_LLE_offset_pair
106	.uleb128 .Ltmp2-.Lfunc_begin0           #   starting offset
107	.uleb128 .Lfunc_end0-.Lfunc_begin0      #   ending offset
108	.byte	4                               # Loc expr size
109	.byte	163                             # DW_OP_entry_value
110	.byte	1                               # 1
111	.byte	84                              # DW_OP_reg4
112	.byte	159                             # DW_OP_stack_value
113	.byte	0                               # DW_LLE_end_of_list
114.Ldebug_loc2:
115	.byte	4                               # DW_LLE_offset_pair
116	.uleb128 .Ltmp2-.Lfunc_begin0           #   starting offset
117	.uleb128 .Ltmp3-.Lfunc_begin0           #   ending offset
118	.byte	3                               # Loc expr size
119	.byte	17                              # DW_OP_consts
120	.byte	0                               # 0
121	.byte	159                             # DW_OP_stack_value
122	.byte	4                               # DW_LLE_offset_pair
123	.uleb128 .Ltmp3-.Lfunc_begin0           #   starting offset
124	.uleb128 .Ltmp4-.Lfunc_begin0           #   ending offset
125	.byte	1                               # Loc expr size
126	.byte	83                              # super-register DW_OP_reg3
127	.byte	4                               # DW_LLE_offset_pair
128	.uleb128 .Ltmp4-.Lfunc_begin0           #   starting offset
129	.uleb128 .Lfunc_end0-.Lfunc_begin0      #   ending offset
130	.byte	1                               # Loc expr size
131	.byte	80                              # super-register DW_OP_reg0
132	.byte	0                               # DW_LLE_end_of_list
133.Ldebug_list_header_end0:
134	.section	.debug_abbrev,"",@progbits
135	.byte	1                               # Abbreviation Code
136	.byte	17                              # DW_TAG_compile_unit
137	.byte	1                               # DW_CHILDREN_yes
138	.byte	37                              # DW_AT_producer
139	.byte	37                              # DW_FORM_strx1
140	.byte	19                              # DW_AT_language
141	.byte	5                               # DW_FORM_data2
142	.byte	3                               # DW_AT_name
143	.byte	37                              # DW_FORM_strx1
144	.byte	114                             # DW_AT_str_offsets_base
145	.byte	23                              # DW_FORM_sec_offset
146	.byte	16                              # DW_AT_stmt_list
147	.byte	23                              # DW_FORM_sec_offset
148	.byte	27                              # DW_AT_comp_dir
149	.byte	37                              # DW_FORM_strx1
150	.byte	17                              # DW_AT_low_pc
151	.byte	27                              # DW_FORM_addrx
152	.byte	18                              # DW_AT_high_pc
153	.byte	6                               # DW_FORM_data4
154	.byte	115                             # DW_AT_addr_base
155	.byte	23                              # DW_FORM_sec_offset
156	.ascii	"\214\001"                      # DW_AT_loclists_base
157	.byte	23                              # DW_FORM_sec_offset
158	.byte	0                               # EOM(1)
159	.byte	0                               # EOM(2)
160	.byte	2                               # Abbreviation Code
161	.byte	46                              # DW_TAG_subprogram
162	.byte	1                               # DW_CHILDREN_yes
163	.byte	110                             # DW_AT_linkage_name
164	.byte	37                              # DW_FORM_strx1
165	.byte	3                               # DW_AT_name
166	.byte	37                              # DW_FORM_strx1
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	32                              # DW_AT_inline
174	.byte	33                              # DW_FORM_implicit_const
175	.byte	1
176	.byte	0                               # EOM(1)
177	.byte	0                               # EOM(2)
178	.byte	3                               # Abbreviation Code
179	.byte	5                               # DW_TAG_formal_parameter
180	.byte	0                               # DW_CHILDREN_no
181	.byte	3                               # DW_AT_name
182	.byte	37                              # DW_FORM_strx1
183	.byte	58                              # DW_AT_decl_file
184	.byte	11                              # DW_FORM_data1
185	.byte	59                              # DW_AT_decl_line
186	.byte	11                              # DW_FORM_data1
187	.byte	73                              # DW_AT_type
188	.byte	19                              # DW_FORM_ref4
189	.byte	0                               # EOM(1)
190	.byte	0                               # EOM(2)
191	.byte	4                               # Abbreviation Code
192	.byte	36                              # DW_TAG_base_type
193	.byte	0                               # DW_CHILDREN_no
194	.byte	3                               # DW_AT_name
195	.byte	37                              # DW_FORM_strx1
196	.byte	62                              # DW_AT_encoding
197	.byte	11                              # DW_FORM_data1
198	.byte	11                              # DW_AT_byte_size
199	.byte	11                              # DW_FORM_data1
200	.byte	0                               # EOM(1)
201	.byte	0                               # EOM(2)
202	.byte	5                               # Abbreviation Code
203	.byte	46                              # DW_TAG_subprogram
204	.byte	1                               # DW_CHILDREN_yes
205	.byte	17                              # DW_AT_low_pc
206	.byte	27                              # DW_FORM_addrx
207	.byte	18                              # DW_AT_high_pc
208	.byte	6                               # DW_FORM_data4
209	.byte	64                              # DW_AT_frame_base
210	.byte	24                              # DW_FORM_exprloc
211	.byte	122                             # DW_AT_call_all_calls
212	.byte	25                              # DW_FORM_flag_present
213	.byte	3                               # DW_AT_name
214	.byte	37                              # DW_FORM_strx1
215	.byte	58                              # DW_AT_decl_file
216	.byte	11                              # DW_FORM_data1
217	.byte	59                              # DW_AT_decl_line
218	.byte	11                              # DW_FORM_data1
219	.byte	73                              # DW_AT_type
220	.byte	19                              # DW_FORM_ref4
221	.byte	63                              # DW_AT_external
222	.byte	25                              # DW_FORM_flag_present
223	.byte	0                               # EOM(1)
224	.byte	0                               # EOM(2)
225	.byte	6                               # Abbreviation Code
226	.byte	5                               # DW_TAG_formal_parameter
227	.byte	0                               # DW_CHILDREN_no
228	.byte	2                               # DW_AT_location
229	.byte	34                              # DW_FORM_loclistx
230	.byte	3                               # DW_AT_name
231	.byte	37                              # DW_FORM_strx1
232	.byte	58                              # DW_AT_decl_file
233	.byte	11                              # DW_FORM_data1
234	.byte	59                              # DW_AT_decl_line
235	.byte	11                              # DW_FORM_data1
236	.byte	73                              # DW_AT_type
237	.byte	19                              # DW_FORM_ref4
238	.byte	0                               # EOM(1)
239	.byte	0                               # EOM(2)
240	.byte	7                               # Abbreviation Code
241	.byte	52                              # DW_TAG_variable
242	.byte	0                               # DW_CHILDREN_no
243	.byte	2                               # DW_AT_location
244	.byte	34                              # DW_FORM_loclistx
245	.byte	3                               # DW_AT_name
246	.byte	37                              # DW_FORM_strx1
247	.byte	58                              # DW_AT_decl_file
248	.byte	11                              # DW_FORM_data1
249	.byte	59                              # DW_AT_decl_line
250	.byte	11                              # DW_FORM_data1
251	.byte	73                              # DW_AT_type
252	.byte	19                              # DW_FORM_ref4
253	.byte	0                               # EOM(1)
254	.byte	0                               # EOM(2)
255	.byte	8                               # Abbreviation Code
256	.byte	29                              # DW_TAG_inlined_subroutine
257	.byte	1                               # DW_CHILDREN_yes
258	.byte	49                              # DW_AT_abstract_origin
259	.byte	19                              # DW_FORM_ref4
260	.byte	17                              # DW_AT_low_pc
261	.byte	27                              # DW_FORM_addrx
262	.byte	18                              # DW_AT_high_pc
263	.byte	6                               # DW_FORM_data4
264	.byte	88                              # DW_AT_call_file
265	.byte	11                              # DW_FORM_data1
266	.byte	89                              # DW_AT_call_line
267	.byte	11                              # DW_FORM_data1
268	.byte	87                              # DW_AT_call_column
269	.byte	11                              # DW_FORM_data1
270	.byte	0                               # EOM(1)
271	.byte	0                               # EOM(2)
272	.byte	9                               # Abbreviation Code
273	.byte	5                               # DW_TAG_formal_parameter
274	.byte	0                               # DW_CHILDREN_no
275	.byte	2                               # DW_AT_location
276	.byte	24                              # DW_FORM_exprloc
277	.byte	49                              # DW_AT_abstract_origin
278	.byte	19                              # DW_FORM_ref4
279	.byte	0                               # EOM(1)
280	.byte	0                               # EOM(2)
281	.byte	10                              # Abbreviation Code
282	.byte	72                              # DW_TAG_call_site
283	.byte	0                               # DW_CHILDREN_no
284	.byte	127                             # DW_AT_call_origin
285	.byte	19                              # DW_FORM_ref4
286	.byte	125                             # DW_AT_call_return_pc
287	.byte	27                              # DW_FORM_addrx
288	.byte	0                               # EOM(1)
289	.byte	0                               # EOM(2)
290	.byte	11                              # Abbreviation Code
291	.byte	46                              # DW_TAG_subprogram
292	.byte	0                               # DW_CHILDREN_no
293	.byte	110                             # DW_AT_linkage_name
294	.byte	37                              # DW_FORM_strx1
295	.byte	3                               # DW_AT_name
296	.byte	37                              # DW_FORM_strx1
297	.byte	58                              # DW_AT_decl_file
298	.byte	11                              # DW_FORM_data1
299	.byte	59                              # DW_AT_decl_line
300	.byte	11                              # DW_FORM_data1
301	.byte	60                              # DW_AT_declaration
302	.byte	25                              # DW_FORM_flag_present
303	.byte	63                              # DW_AT_external
304	.byte	25                              # DW_FORM_flag_present
305	.byte	0                               # EOM(1)
306	.byte	0                               # EOM(2)
307	.byte	12                              # Abbreviation Code
308	.byte	15                              # DW_TAG_pointer_type
309	.byte	0                               # DW_CHILDREN_no
310	.byte	73                              # DW_AT_type
311	.byte	19                              # DW_FORM_ref4
312	.byte	0                               # EOM(1)
313	.byte	0                               # EOM(2)
314	.byte	0                               # EOM(3)
315	.section	.debug_info,"",@progbits
316.Lcu_begin0:
317	.long	.Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit
318.Ldebug_info_start0:
319	.short	5                               # DWARF version number
320	.byte	1                               # DWARF Unit Type
321	.byte	8                               # Address Size (in bytes)
322	.long	.debug_abbrev                   # Offset Into Abbrev. Section
323	.byte	1                               # Abbrev [1] 0xc:0x8b DW_TAG_compile_unit
324	.byte	0                               # DW_AT_producer
325	.short	33                              # DW_AT_language
326	.byte	1                               # DW_AT_name
327	.long	.Lstr_offsets_base0             # DW_AT_str_offsets_base
328	.long	.Lline_table_start0             # DW_AT_stmt_list
329	.byte	2                               # DW_AT_comp_dir
330	.byte	0                               # DW_AT_low_pc
331	.long	.Lfunc_end0-.Lfunc_begin0       # DW_AT_high_pc
332	.long	.Laddr_table_base0              # DW_AT_addr_base
333	.long	.Lloclists_table_base0          # DW_AT_loclists_base
334	.byte	2                               # Abbrev [2] 0x27:0x12 DW_TAG_subprogram
335	.byte	3                               # DW_AT_linkage_name
336	.byte	4                               # DW_AT_name
337	.byte	0                               # DW_AT_decl_file
338	.byte	1                               # DW_AT_decl_line
339	.long	57                              # DW_AT_type
340                                        # DW_AT_inline
341	.byte	3                               # Abbrev [3] 0x30:0x8 DW_TAG_formal_parameter
342	.byte	6                               # DW_AT_name
343	.byte	0                               # DW_AT_decl_file
344	.byte	1                               # DW_AT_decl_line
345	.long	57                              # DW_AT_type
346	.byte	0                               # End Of Children Mark
347	.byte	4                               # Abbrev [4] 0x39:0x4 DW_TAG_base_type
348	.byte	5                               # DW_AT_name
349	.byte	5                               # DW_AT_encoding
350	.byte	4                               # DW_AT_byte_size
351	.byte	5                               # Abbrev [5] 0x3d:0x46 DW_TAG_subprogram
352	.byte	0                               # DW_AT_low_pc
353	.long	.Lfunc_end0-.Lfunc_begin0       # DW_AT_high_pc
354	.byte	1                               # DW_AT_frame_base
355	.byte	87
356                                        # DW_AT_call_all_calls
357	.byte	9                               # DW_AT_name
358	.byte	0                               # DW_AT_decl_file
359	.byte	5                               # DW_AT_decl_line
360	.long	57                              # DW_AT_type
361                                        # DW_AT_external
362	.byte	6                               # Abbrev [6] 0x4c:0x9 DW_TAG_formal_parameter
363	.byte	0                               # DW_AT_location
364	.byte	10                              # DW_AT_name
365	.byte	0                               # DW_AT_decl_file
366	.byte	5                               # DW_AT_decl_line
367	.long	57                              # DW_AT_type
368	.byte	6                               # Abbrev [6] 0x55:0x9 DW_TAG_formal_parameter
369	.byte	1                               # DW_AT_location
370	.byte	11                              # DW_AT_name
371	.byte	0                               # DW_AT_decl_file
372	.byte	5                               # DW_AT_decl_line
373	.long	136                             # DW_AT_type
374	.byte	7                               # Abbrev [7] 0x5e:0x9 DW_TAG_variable
375	.byte	2                               # DW_AT_location
376	.byte	13                              # DW_AT_name
377	.byte	0                               # DW_AT_decl_file
378	.byte	8                               # DW_AT_decl_line
379	.long	57                              # DW_AT_type
380	.byte	8                               # Abbrev [8] 0x67:0x15 DW_TAG_inlined_subroutine
381	.long	39                              # DW_AT_abstract_origin
382	.byte	1                               # DW_AT_low_pc
383	.long	.Ltmp3-.Ltmp2                   # DW_AT_high_pc
384	.byte	0                               # DW_AT_call_file
385	.byte	9                               # DW_AT_call_line
386	.byte	32                              # DW_AT_call_column
387	.byte	9                               # Abbrev [9] 0x74:0x7 DW_TAG_formal_parameter
388	.byte	1                               # DW_AT_location
389	.byte	83
390	.long	48                              # DW_AT_abstract_origin
391	.byte	0                               # End Of Children Mark
392	.byte	10                              # Abbrev [10] 0x7c:0x6 DW_TAG_call_site
393	.long	131                             # DW_AT_call_origin
394	.byte	1                               # DW_AT_call_return_pc
395	.byte	0                               # End Of Children Mark
396	.byte	11                              # Abbrev [11] 0x83:0x5 DW_TAG_subprogram
397	.byte	7                               # DW_AT_linkage_name
398	.byte	8                               # DW_AT_name
399	.byte	0                               # DW_AT_decl_file
400	.byte	4                               # DW_AT_decl_line
401                                        # DW_AT_declaration
402                                        # DW_AT_external
403	.byte	12                              # Abbrev [12] 0x88:0x5 DW_TAG_pointer_type
404	.long	141                             # DW_AT_type
405	.byte	12                              # Abbrev [12] 0x8d:0x5 DW_TAG_pointer_type
406	.long	146                             # DW_AT_type
407	.byte	4                               # Abbrev [4] 0x92:0x4 DW_TAG_base_type
408	.byte	12                              # DW_AT_name
409	.byte	6                               # DW_AT_encoding
410	.byte	1                               # DW_AT_byte_size
411	.byte	0                               # End Of Children Mark
412.Ldebug_info_end0:
413	.section	.debug_str_offsets,"",@progbits
414	.long	60                              # Length of String Offsets Set
415	.short	5
416	.short	0
417.Lstr_offsets_base0:
418	.section	.debug_str,"MS",@progbits,1
419.Linfo_string0:
420	.asciz	"clang version 17.0.0 (https://github.com/llvm/llvm-project.git 640e07c49037cca41a1bfbeb916b569d8c950aea)" # string offset=0
421.Linfo_string1:
422	.asciz	"main.cpp"                      # string offset=105
423.Linfo_string2:
424	.asciz	"." # string offset=114
425.Linfo_string3:
426	.asciz	"_ZL6helperi"                   # string offset=152
427.Linfo_string4:
428	.asciz	"helper"                        # string offset=164
429.Linfo_string5:
430	.asciz	"int"                           # string offset=171
431.Linfo_string6:
432	.asciz	"i"                             # string offset=175
433.Linfo_string7:
434	.asciz	"_Z13may_not_existv"            # string offset=177
435.Linfo_string8:
436	.asciz	"may_not_exist"                 # string offset=196
437.Linfo_string9:
438	.asciz	"main"                          # string offset=210
439.Linfo_string10:
440	.asciz	"argc"                          # string offset=215
441.Linfo_string11:
442	.asciz	"argv"                          # string offset=220
443.Linfo_string12:
444	.asciz	"char"                          # string offset=225
445.Linfo_string13:
446	.asciz	"j"                             # string offset=230
447	.section	.debug_str_offsets,"",@progbits
448	.long	.Linfo_string0
449	.long	.Linfo_string1
450	.long	.Linfo_string2
451	.long	.Linfo_string3
452	.long	.Linfo_string4
453	.long	.Linfo_string5
454	.long	.Linfo_string6
455	.long	.Linfo_string7
456	.long	.Linfo_string8
457	.long	.Linfo_string9
458	.long	.Linfo_string10
459	.long	.Linfo_string11
460	.long	.Linfo_string12
461	.long	.Linfo_string13
462	.section	.debug_addr,"",@progbits
463	.long	.Ldebug_addr_end0-.Ldebug_addr_start0 # Length of contribution
464.Ldebug_addr_start0:
465	.short	5                               # DWARF version number
466	.byte	8                               # Address size
467	.byte	0                               # Segment selector size
468.Laddr_table_base0:
469	.quad	.Lfunc_begin0
470	.quad	.Ltmp2
471.Ldebug_addr_end0:
472	.weak	_Z13may_not_existv
473	.ident	"clang version 17.0.0 (https://github.com/llvm/llvm-project.git 640e07c49037cca41a1bfbeb916b569d8c950aea)"
474	.section	".note.GNU-stack","",@progbits
475	.addrsig
476	.addrsig_sym _Z13may_not_existv
477	.section	.debug_line,"",@progbits
478.Lline_table_start0:
479