xref: /llvm-project/bolt/test/X86/Inputs/dwarf5-subprogram-multiple-ranges-main.s (revision 75f770a68f70498f0b5229597f70dd8204c66e7c)
1# clang++ -fbasic-block-sections=all -ffunction-sections -g2 -gdwarf-5
2# int doStuff(int val) {
3#   if (val)
4#     ++val;
5#   return val;
6# }
7#
8# int main(int argc, const char** argv) {
9#     return  doStuff(argc);
10# }
11	.text
12	.file	"main.cpp"
13	.section	.text._Z7doStuffi,"ax",@progbits
14	.globl	_Z7doStuffi                     # -- Begin function _Z7doStuffi
15	.p2align	4, 0x90
16	.type	_Z7doStuffi,@function
17_Z7doStuffi:                            # @_Z7doStuffi
18.Lfunc_begin0:
19	.file	0 "/subprogramRanges" "main.cpp" md5 0x45fd34ef778739dca24be206894f1d15
20	.loc	0 1 0                           # main.cpp:1:0
21	.cfi_startproc
22# %bb.0:                                # %entry
23	pushq	%rbp
24	.cfi_def_cfa_offset 16
25	.cfi_offset %rbp, -16
26	movq	%rsp, %rbp
27	.cfi_def_cfa_register %rbp
28	movl	%edi, -4(%rbp)
29.Ltmp0:
30	.loc	0 2 7 prologue_end              # main.cpp:2:7
31	cmpl	$0, -4(%rbp)
32.Ltmp1:
33	.loc	0 2 7 is_stmt 0                 # main.cpp:2:7
34	je	_Z7doStuffi.__part.2
35	jmp	_Z7doStuffi.__part.1
36.LBB_END0_0:
37	.cfi_endproc
38	.section	.text._Z7doStuffi,"ax",@progbits,unique,1
39_Z7doStuffi.__part.1:                   # %if.then
40	.cfi_startproc
41	.cfi_def_cfa %rbp, 16
42	.cfi_offset %rbp, -16
43	.loc	0 3 5 is_stmt 1                 # main.cpp:3:5
44	movl	-4(%rbp), %eax
45	addl	$1, %eax
46	movl	%eax, -4(%rbp)
47	jmp	_Z7doStuffi.__part.2
48.LBB_END0_1:
49	.size	_Z7doStuffi.__part.1, .LBB_END0_1-_Z7doStuffi.__part.1
50	.cfi_endproc
51	.section	.text._Z7doStuffi,"ax",@progbits,unique,2
52_Z7doStuffi.__part.2:                   # %if.end
53	.cfi_startproc
54	.cfi_def_cfa %rbp, 16
55	.cfi_offset %rbp, -16
56	.loc	0 4 10                          # main.cpp:4:10
57	movl	-4(%rbp), %eax
58	.loc	0 4 3 epilogue_begin is_stmt 0  # main.cpp:4:3
59	popq	%rbp
60	.cfi_def_cfa %rsp, 8
61	retq
62.LBB_END0_2:
63	.size	_Z7doStuffi.__part.2, .LBB_END0_2-_Z7doStuffi.__part.2
64	.cfi_endproc
65	.section	.text._Z7doStuffi,"ax",@progbits
66.Lfunc_end0:
67	.size	_Z7doStuffi, .Lfunc_end0-_Z7doStuffi
68                                        # -- End function
69	.section	.text.main,"ax",@progbits
70	.globl	main                            # -- Begin function main
71	.p2align	4, 0x90
72	.type	main,@function
73main:                                   # @main
74.Lfunc_begin1:
75	.loc	0 7 0 is_stmt 1                 # main.cpp:7:0
76	.cfi_startproc
77# %bb.0:                                # %entry
78	pushq	%rbp
79	.cfi_def_cfa_offset 16
80	.cfi_offset %rbp, -16
81	movq	%rsp, %rbp
82	.cfi_def_cfa_register %rbp
83	subq	$16, %rsp
84	movl	$0, -4(%rbp)
85	movl	%edi, -8(%rbp)
86	movq	%rsi, -16(%rbp)
87.Ltmp2:
88	.loc	0 8 21 prologue_end             # main.cpp:8:21
89	movl	-8(%rbp), %edi
90	.loc	0 8 13 is_stmt 0                # main.cpp:8:13
91	callq	_Z7doStuffi
92	.loc	0 8 5 epilogue_begin            # main.cpp:8:5
93	addq	$16, %rsp
94	popq	%rbp
95	.cfi_def_cfa %rsp, 8
96	retq
97.LBB_END1_0:
98	.cfi_endproc
99.Lfunc_end1:
100	.size	main, .Lfunc_end1-main
101                                        # -- End function
102	.section	.debug_abbrev,"",@progbits
103	.byte	1                               # Abbreviation Code
104	.byte	17                              # DW_TAG_compile_unit
105	.byte	1                               # DW_CHILDREN_yes
106	.byte	37                              # DW_AT_producer
107	.byte	37                              # DW_FORM_strx1
108	.byte	19                              # DW_AT_language
109	.byte	5                               # DW_FORM_data2
110	.byte	3                               # DW_AT_name
111	.byte	37                              # DW_FORM_strx1
112	.byte	114                             # DW_AT_str_offsets_base
113	.byte	23                              # DW_FORM_sec_offset
114	.byte	16                              # DW_AT_stmt_list
115	.byte	23                              # DW_FORM_sec_offset
116	.byte	27                              # DW_AT_comp_dir
117	.byte	37                              # DW_FORM_strx1
118	.byte	17                              # DW_AT_low_pc
119	.byte	1                               # DW_FORM_addr
120	.byte	85                              # DW_AT_ranges
121	.byte	35                              # DW_FORM_rnglistx
122	.byte	115                             # DW_AT_addr_base
123	.byte	23                              # DW_FORM_sec_offset
124	.byte	116                             # DW_AT_rnglists_base
125	.byte	23                              # DW_FORM_sec_offset
126	.byte	0                               # EOM(1)
127	.byte	0                               # EOM(2)
128	.byte	2                               # Abbreviation Code
129	.byte	46                              # DW_TAG_subprogram
130	.byte	1                               # DW_CHILDREN_yes
131	.byte	85                              # DW_AT_ranges
132	.byte	35                              # DW_FORM_rnglistx
133	.byte	64                              # DW_AT_frame_base
134	.byte	24                              # DW_FORM_exprloc
135	.byte	110                             # DW_AT_linkage_name
136	.byte	37                              # DW_FORM_strx1
137	.byte	3                               # DW_AT_name
138	.byte	37                              # DW_FORM_strx1
139	.byte	58                              # DW_AT_decl_file
140	.byte	11                              # DW_FORM_data1
141	.byte	59                              # DW_AT_decl_line
142	.byte	11                              # DW_FORM_data1
143	.byte	73                              # DW_AT_type
144	.byte	19                              # DW_FORM_ref4
145	.byte	63                              # DW_AT_external
146	.byte	25                              # DW_FORM_flag_present
147	.byte	0                               # EOM(1)
148	.byte	0                               # EOM(2)
149	.byte	3                               # Abbreviation Code
150	.byte	5                               # DW_TAG_formal_parameter
151	.byte	0                               # DW_CHILDREN_no
152	.byte	2                               # DW_AT_location
153	.byte	24                              # DW_FORM_exprloc
154	.byte	3                               # DW_AT_name
155	.byte	37                              # DW_FORM_strx1
156	.byte	58                              # DW_AT_decl_file
157	.byte	11                              # DW_FORM_data1
158	.byte	59                              # DW_AT_decl_line
159	.byte	11                              # DW_FORM_data1
160	.byte	73                              # DW_AT_type
161	.byte	19                              # DW_FORM_ref4
162	.byte	0                               # EOM(1)
163	.byte	0                               # EOM(2)
164	.byte	4                               # Abbreviation Code
165	.byte	46                              # DW_TAG_subprogram
166	.byte	1                               # DW_CHILDREN_yes
167	.byte	17                              # DW_AT_low_pc
168	.byte	27                              # DW_FORM_addrx
169	.byte	18                              # DW_AT_high_pc
170	.byte	6                               # DW_FORM_data4
171	.byte	64                              # DW_AT_frame_base
172	.byte	24                              # DW_FORM_exprloc
173	.byte	3                               # DW_AT_name
174	.byte	37                              # DW_FORM_strx1
175	.byte	58                              # DW_AT_decl_file
176	.byte	11                              # DW_FORM_data1
177	.byte	59                              # DW_AT_decl_line
178	.byte	11                              # DW_FORM_data1
179	.byte	73                              # DW_AT_type
180	.byte	19                              # DW_FORM_ref4
181	.byte	63                              # DW_AT_external
182	.byte	25                              # DW_FORM_flag_present
183	.byte	0                               # EOM(1)
184	.byte	0                               # EOM(2)
185	.byte	5                               # Abbreviation Code
186	.byte	36                              # DW_TAG_base_type
187	.byte	0                               # DW_CHILDREN_no
188	.byte	3                               # DW_AT_name
189	.byte	37                              # DW_FORM_strx1
190	.byte	62                              # DW_AT_encoding
191	.byte	11                              # DW_FORM_data1
192	.byte	11                              # DW_AT_byte_size
193	.byte	11                              # DW_FORM_data1
194	.byte	0                               # EOM(1)
195	.byte	0                               # EOM(2)
196	.byte	6                               # Abbreviation Code
197	.byte	15                              # DW_TAG_pointer_type
198	.byte	0                               # DW_CHILDREN_no
199	.byte	73                              # DW_AT_type
200	.byte	19                              # DW_FORM_ref4
201	.byte	0                               # EOM(1)
202	.byte	0                               # EOM(2)
203	.byte	7                               # Abbreviation Code
204	.byte	38                              # DW_TAG_const_type
205	.byte	0                               # DW_CHILDREN_no
206	.byte	73                              # DW_AT_type
207	.byte	19                              # DW_FORM_ref4
208	.byte	0                               # EOM(1)
209	.byte	0                               # EOM(2)
210	.byte	0                               # EOM(3)
211	.section	.debug_info,"",@progbits
212.Lcu_begin0:
213	.long	.Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit
214.Ldebug_info_start0:
215	.short	5                               # DWARF version number
216	.byte	1                               # DWARF Unit Type
217	.byte	8                               # Address Size (in bytes)
218	.long	.debug_abbrev                   # Offset Into Abbrev. Section
219	.byte	1                               # Abbrev [1] 0xc:0x75 DW_TAG_compile_unit
220	.byte	0                               # DW_AT_producer
221	.short	33                              # DW_AT_language
222	.byte	1                               # DW_AT_name
223	.long	.Lstr_offsets_base0             # DW_AT_str_offsets_base
224	.long	.Lline_table_start0             # DW_AT_stmt_list
225	.byte	2                               # DW_AT_comp_dir
226	.quad	0                               # DW_AT_low_pc
227	.byte	1                               # DW_AT_ranges
228	.long	.Laddr_table_base0              # DW_AT_addr_base
229	.long	.Lrnglists_table_base0          # DW_AT_rnglists_base
230	.byte	2                               # Abbrev [2] 0x2b:0x18 DW_TAG_subprogram
231	.byte	0                               # DW_AT_ranges
232	.byte	1                               # DW_AT_frame_base
233	.byte	86
234	.byte	3                               # DW_AT_linkage_name
235	.byte	4                               # DW_AT_name
236	.byte	0                               # DW_AT_decl_file
237	.byte	1                               # DW_AT_decl_line
238	.long	105                             # DW_AT_type
239                                        # DW_AT_external
240	.byte	3                               # Abbrev [3] 0x37:0xb DW_TAG_formal_parameter
241	.byte	2                               # DW_AT_location
242	.byte	145
243	.byte	124
244	.byte	7                               # DW_AT_name
245	.byte	0                               # DW_AT_decl_file
246	.byte	1                               # DW_AT_decl_line
247	.long	105                             # DW_AT_type
248	.byte	0                               # End Of Children Mark
249	.byte	4                               # Abbrev [4] 0x43:0x26 DW_TAG_subprogram
250	.byte	3                               # DW_AT_low_pc
251	.long	.Lfunc_end1-.Lfunc_begin1       # DW_AT_high_pc
252	.byte	1                               # DW_AT_frame_base
253	.byte	86
254	.byte	6                               # DW_AT_name
255	.byte	0                               # DW_AT_decl_file
256	.byte	7                               # DW_AT_decl_line
257	.long	105                             # DW_AT_type
258                                        # DW_AT_external
259	.byte	3                               # Abbrev [3] 0x52:0xb DW_TAG_formal_parameter
260	.byte	2                               # DW_AT_location
261	.byte	145
262	.byte	120
263	.byte	8                               # DW_AT_name
264	.byte	0                               # DW_AT_decl_file
265	.byte	7                               # DW_AT_decl_line
266	.long	105                             # DW_AT_type
267	.byte	3                               # Abbrev [3] 0x5d:0xb DW_TAG_formal_parameter
268	.byte	2                               # DW_AT_location
269	.byte	145
270	.byte	112
271	.byte	9                               # DW_AT_name
272	.byte	0                               # DW_AT_decl_file
273	.byte	7                               # DW_AT_decl_line
274	.long	109                             # DW_AT_type
275	.byte	0                               # End Of Children Mark
276	.byte	5                               # Abbrev [5] 0x69:0x4 DW_TAG_base_type
277	.byte	5                               # DW_AT_name
278	.byte	5                               # DW_AT_encoding
279	.byte	4                               # DW_AT_byte_size
280	.byte	6                               # Abbrev [6] 0x6d:0x5 DW_TAG_pointer_type
281	.long	114                             # DW_AT_type
282	.byte	6                               # Abbrev [6] 0x72:0x5 DW_TAG_pointer_type
283	.long	119                             # DW_AT_type
284	.byte	7                               # Abbrev [7] 0x77:0x5 DW_TAG_const_type
285	.long	124                             # DW_AT_type
286	.byte	5                               # Abbrev [5] 0x7c:0x4 DW_TAG_base_type
287	.byte	10                              # DW_AT_name
288	.byte	6                               # DW_AT_encoding
289	.byte	1                               # DW_AT_byte_size
290	.byte	0                               # End Of Children Mark
291.Ldebug_info_end0:
292	.section	.debug_rnglists,"",@progbits
293	.long	.Ldebug_list_header_end0-.Ldebug_list_header_start0 # Length
294.Ldebug_list_header_start0:
295	.short	5                               # Version
296	.byte	8                               # Address size
297	.byte	0                               # Segment selector size
298	.long	2                               # Offset entry count
299.Lrnglists_table_base0:
300	.long	.Ldebug_ranges0-.Lrnglists_table_base0
301	.long	.Ldebug_ranges1-.Lrnglists_table_base0
302.Ldebug_ranges0:
303	.byte	3                               # DW_RLE_startx_length
304	.byte	0                               #   start index
305	.uleb128 .LBB_END0_1-_Z7doStuffi.__part.1 #   length
306	.byte	3                               # DW_RLE_startx_length
307	.byte	1                               #   start index
308	.uleb128 .LBB_END0_2-_Z7doStuffi.__part.2 #   length
309	.byte	3                               # DW_RLE_startx_length
310	.byte	2                               #   start index
311	.uleb128 .Lfunc_end0-.Lfunc_begin0      #   length
312	.byte	0                               # DW_RLE_end_of_list
313.Ldebug_ranges1:
314	.byte	3                               # DW_RLE_startx_length
315	.byte	0                               #   start index
316	.uleb128 .LBB_END0_1-_Z7doStuffi.__part.1 #   length
317	.byte	3                               # DW_RLE_startx_length
318	.byte	1                               #   start index
319	.uleb128 .LBB_END0_2-_Z7doStuffi.__part.2 #   length
320	.byte	3                               # DW_RLE_startx_length
321	.byte	2                               #   start index
322	.uleb128 .Lfunc_end0-.Lfunc_begin0      #   length
323	.byte	3                               # DW_RLE_startx_length
324	.byte	3                               #   start index
325	.uleb128 .Lfunc_end1-.Lfunc_begin1      #   length
326	.byte	0                               # DW_RLE_end_of_list
327.Ldebug_list_header_end0:
328	.section	.debug_str_offsets,"",@progbits
329	.long	48                              # Length of String Offsets Set
330	.short	5
331	.short	0
332.Lstr_offsets_base0:
333	.section	.debug_str,"MS",@progbits,1
334.Linfo_string0:
335	.asciz	"clang version 17.0.0 (https://github.com/llvm/llvm-project.git 640e07c49037cca41a1bfbeb916b569d8c950aea)" # string offset=0
336.Linfo_string1:
337	.asciz	"main.cpp"                      # string offset=105
338.Linfo_string2:
339	.asciz	"/subprogramRanges" # string offset=114
340.Linfo_string3:
341	.asciz	"_Z7doStuffi"                   # string offset=169
342.Linfo_string4:
343	.asciz	"doStuff"                       # string offset=181
344.Linfo_string5:
345	.asciz	"int"                           # string offset=189
346.Linfo_string6:
347	.asciz	"main"                          # string offset=193
348.Linfo_string7:
349	.asciz	"val"                           # string offset=198
350.Linfo_string8:
351	.asciz	"argc"                          # string offset=202
352.Linfo_string9:
353	.asciz	"argv"                          # string offset=207
354.Linfo_string10:
355	.asciz	"char"                          # string offset=212
356	.section	.debug_str_offsets,"",@progbits
357	.long	.Linfo_string0
358	.long	.Linfo_string1
359	.long	.Linfo_string2
360	.long	.Linfo_string3
361	.long	.Linfo_string4
362	.long	.Linfo_string5
363	.long	.Linfo_string6
364	.long	.Linfo_string7
365	.long	.Linfo_string8
366	.long	.Linfo_string9
367	.long	.Linfo_string10
368	.section	.debug_addr,"",@progbits
369	.long	.Ldebug_addr_end0-.Ldebug_addr_start0 # Length of contribution
370.Ldebug_addr_start0:
371	.short	5                               # DWARF version number
372	.byte	8                               # Address size
373	.byte	0                               # Segment selector size
374.Laddr_table_base0:
375	.quad	_Z7doStuffi.__part.1
376	.quad	_Z7doStuffi.__part.2
377	.quad	.Lfunc_begin0
378	.quad	.Lfunc_begin1
379.Ldebug_addr_end0:
380	.ident	"clang version 17.0.0 (https://github.com/llvm/llvm-project.git 640e07c49037cca41a1bfbeb916b569d8c950aea)"
381	.section	".note.GNU-stack","",@progbits
382	.addrsig
383	.addrsig_sym _Z7doStuffi
384	.section	.debug_line,"",@progbits
385.Lline_table_start0:
386