xref: /llvm-project/bolt/test/X86/Inputs/dwarf4-split-dwarf-no-address-main.s (revision 3abb68a626160e019c30a4860e569d7bc75e486a)
1# extern int helper(int i);
2# void use(int * x, int * y) {
3#  *x += 4;
4#  *y -= 2;
5# }
6#
7# int x = 0;
8# int y = 1;
9# int  main(int argc, char *argv[]) {
10#   x = argc;
11#   y = argc + 3;
12#   use(&x, &y);
13#   return x + helper(y);
14# }
15
16	.text
17	.file	"main.cpp"
18	.file	1 "." "main.cpp"
19	.globl	_Z3usePiS_                      # -- Begin function _Z3usePiS_
20	.p2align	4, 0x90
21	.type	_Z3usePiS_,@function
22_Z3usePiS_:                             # @_Z3usePiS_
23.Lfunc_begin0:
24	.loc	1 2 0                           # main.cpp:2:0
25	.cfi_startproc
26# %bb.0:                                # %entry
27	pushq	%rbp
28	.cfi_def_cfa_offset 16
29	.cfi_offset %rbp, -16
30	movq	%rsp, %rbp
31	.cfi_def_cfa_register %rbp
32	movq	%rdi, -8(%rbp)
33	movq	%rsi, -16(%rbp)
34.Ltmp0:
35	.loc	1 3 3 prologue_end              # main.cpp:3:3
36	movq	-8(%rbp), %rax
37	.loc	1 3 5 is_stmt 0                 # main.cpp:3:5
38	movl	(%rax), %ecx
39	addl	$4, %ecx
40	movl	%ecx, (%rax)
41	.loc	1 4 3 is_stmt 1                 # main.cpp:4:3
42	movq	-16(%rbp), %rax
43	.loc	1 4 5 is_stmt 0                 # main.cpp:4:5
44	movl	(%rax), %ecx
45	subl	$2, %ecx
46	movl	%ecx, (%rax)
47	.loc	1 5 1 is_stmt 1                 # main.cpp:5:1
48	popq	%rbp
49	.cfi_def_cfa %rsp, 8
50	retq
51.Ltmp1:
52.Lfunc_end0:
53	.size	_Z3usePiS_, .Lfunc_end0-_Z3usePiS_
54	.cfi_endproc
55                                        # -- End function
56	.globl	main                            # -- Begin function main
57	.p2align	4, 0x90
58	.type	main,@function
59main:                                   # @main
60.Lfunc_begin1:
61	.loc	1 9 0                           # main.cpp:9:0
62	.cfi_startproc
63# %bb.0:                                # %entry
64	pushq	%rbp
65	.cfi_def_cfa_offset 16
66	.cfi_offset %rbp, -16
67	movq	%rsp, %rbp
68	.cfi_def_cfa_register %rbp
69	subq	$32, %rsp
70	movl	$0, -4(%rbp)
71	movl	%edi, -8(%rbp)
72	movq	%rsi, -16(%rbp)
73.Ltmp2:
74	.loc	1 10 7 prologue_end             # main.cpp:10:7
75	movl	-8(%rbp), %eax
76	.loc	1 10 5 is_stmt 0                # main.cpp:10:5
77	movl	%eax, x
78	.loc	1 11 7 is_stmt 1                # main.cpp:11:7
79	movl	-8(%rbp), %eax
80	.loc	1 11 12 is_stmt 0               # main.cpp:11:12
81	addl	$3, %eax
82	.loc	1 11 5                          # main.cpp:11:5
83	movl	%eax, y
84	.loc	1 12 3 is_stmt 1                # main.cpp:12:3
85	movabsq	$x, %rdi
86	movabsq	$y, %rsi
87	callq	_Z3usePiS_
88	.loc	1 13 10                         # main.cpp:13:10
89	movl	x, %eax
90	movl	%eax, -20(%rbp)                 # 4-byte Spill
91	.loc	1 13 21 is_stmt 0               # main.cpp:13:21
92	movl	y, %edi
93	.loc	1 13 14                         # main.cpp:13:14
94	callq	_Z6helperi
95	movl	%eax, %ecx
96	movl	-20(%rbp), %eax                 # 4-byte Reload
97	.loc	1 13 12                         # main.cpp:13:12
98	addl	%ecx, %eax
99	.loc	1 13 3                          # main.cpp:13:3
100	addq	$32, %rsp
101	popq	%rbp
102	.cfi_def_cfa %rsp, 8
103	retq
104.Ltmp3:
105.Lfunc_end1:
106	.size	main, .Lfunc_end1-main
107	.cfi_endproc
108                                        # -- End function
109	.type	x,@object                       # @x
110	.bss
111	.globl	x
112	.p2align	2
113x:
114	.long	0                               # 0x0
115	.size	x, 4
116
117	.type	y,@object                       # @y
118	.data
119	.globl	y
120	.p2align	2
121y:
122	.long	1                               # 0x1
123	.size	y, 4
124
125	.section	.debug_abbrev,"",@progbits
126	.byte	1                               # Abbreviation Code
127	.byte	17                              # DW_TAG_compile_unit
128	.byte	0                               # DW_CHILDREN_no
129	.byte	16                              # DW_AT_stmt_list
130	.byte	23                              # DW_FORM_sec_offset
131	.byte	27                              # DW_AT_comp_dir
132	.byte	14                              # DW_FORM_strp
133	.ascii	"\264B"                         # DW_AT_GNU_pubnames
134	.byte	25                              # DW_FORM_flag_present
135	.ascii	"\260B"                         # DW_AT_GNU_dwo_name
136	.byte	14                              # DW_FORM_strp
137	.ascii	"\261B"                         # DW_AT_GNU_dwo_id
138	.byte	7                               # DW_FORM_data8
139	.byte	17                              # DW_AT_low_pc
140	.byte	1                               # DW_FORM_addr
141	.byte	18                              # DW_AT_high_pc
142	.byte	6                               # DW_FORM_data4
143	.ascii	"\263B"                         # DW_AT_GNU_addr_base
144	.byte	23                              # DW_FORM_sec_offset
145	.byte	0                               # EOM(1)
146	.byte	0                               # EOM(2)
147	.byte	0                               # EOM(3)
148	.section	.debug_info,"",@progbits
149.Lcu_begin0:
150	.long	.Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit
151.Ldebug_info_start0:
152	.short	4                               # DWARF version number
153	.long	.debug_abbrev                   # Offset Into Abbrev. Section
154	.byte	8                               # Address Size (in bytes)
155	.byte	1                               # Abbrev [1] 0xb:0x25 DW_TAG_compile_unit
156	.long	.Lline_table_start0             # DW_AT_stmt_list
157	.long	.Lskel_string0                  # DW_AT_comp_dir
158                                        # DW_AT_GNU_pubnames
159	.long	.Lskel_string1                  # DW_AT_GNU_dwo_name
160	.quad	4587139501222431648             # DW_AT_GNU_dwo_id
161	.quad	.Lfunc_begin0                   # DW_AT_low_pc
162	.long	.Lfunc_end1-.Lfunc_begin0       # DW_AT_high_pc
163	.long	.Laddr_table_base0              # DW_AT_GNU_addr_base
164.Ldebug_info_end0:
165	.section	.debug_str,"MS",@progbits,1
166.Lskel_string0:
167	.asciz	"." # string offset=0
168.Lskel_string1:
169	.asciz	"main.dwo"                      # string offset=38
170	.section	.debug_str.dwo,"eMS",@progbits,1
171.Linfo_string0:
172	.asciz	"x"                             # string offset=0
173.Linfo_string1:
174	.asciz	"int"                           # string offset=2
175.Linfo_string2:
176	.asciz	"y"                             # string offset=6
177.Linfo_string3:
178	.asciz	"_Z3usePiS_"                    # string offset=8
179.Linfo_string4:
180	.asciz	"use"                           # string offset=19
181.Linfo_string5:
182	.asciz	"main"                          # string offset=23
183.Linfo_string6:
184	.asciz	"argc"                          # string offset=28
185.Linfo_string7:
186	.asciz	"argv"                          # string offset=33
187.Linfo_string8:
188	.asciz	"char"                          # string offset=38
189.Linfo_string9:
190	.asciz	"clang version 15.0.0" # string offset=43
191.Linfo_string10:
192	.asciz	"main.cpp"                      # string offset=177
193.Linfo_string11:
194	.asciz	"main.dwo"                      # string offset=186
195	.section	.debug_str_offsets.dwo,"e",@progbits
196	.long	0
197	.long	2
198	.long	6
199	.long	8
200	.long	19
201	.long	23
202	.long	28
203	.long	33
204	.long	38
205	.long	43
206	.long	177
207	.long	186
208	.section	.debug_info.dwo,"e",@progbits
209	.long	.Ldebug_info_dwo_end0-.Ldebug_info_dwo_start0 # Length of Unit
210.Ldebug_info_dwo_start0:
211	.short	4                               # DWARF version number
212	.long	0                               # Offset Into Abbrev. Section
213	.byte	8                               # Address Size (in bytes)
214	.byte	1                               # Abbrev [1] 0xb:0x85 DW_TAG_compile_unit
215	.byte	9                               # DW_AT_producer
216	.short	33                              # DW_AT_language
217	.byte	10                              # DW_AT_name
218	.byte	11                              # DW_AT_GNU_dwo_name
219	.quad	4587139501222431648             # DW_AT_GNU_dwo_id
220	.byte	2                               # Abbrev [2] 0x19:0xb DW_TAG_variable
221	.byte	0                               # DW_AT_name
222	.long	36                              # DW_AT_type
223                                        # DW_AT_external
224	.byte	1                               # DW_AT_decl_file
225	.byte	7                               # DW_AT_decl_line
226	.byte	2                               # DW_AT_location
227	.byte	251
228	.byte	0
229	.byte	3                               # Abbrev [3] 0x24:0x4 DW_TAG_base_type
230	.byte	1                               # DW_AT_name
231	.byte	5                               # DW_AT_encoding
232	.byte	4                               # DW_AT_byte_size
233	.byte	2                               # Abbrev [2] 0x28:0xb DW_TAG_variable
234	.byte	2                               # DW_AT_name
235	.long	36                              # DW_AT_type
236                                        # DW_AT_external
237	.byte	1                               # DW_AT_decl_file
238	.byte	8                               # DW_AT_decl_line
239	.byte	2                               # DW_AT_location
240	.byte	251
241	.byte	1
242	.byte	4                               # Abbrev [4] 0x33:0x23 DW_TAG_subprogram
243	.byte	2                               # DW_AT_low_pc
244	.long	.Lfunc_end0-.Lfunc_begin0       # DW_AT_high_pc
245	.byte	1                               # DW_AT_frame_base
246	.byte	86
247	.byte	3                               # DW_AT_linkage_name
248	.byte	4                               # DW_AT_name
249	.byte	1                               # DW_AT_decl_file
250	.byte	2                               # DW_AT_decl_line
251                                        # DW_AT_external
252	.byte	5                               # Abbrev [5] 0x3f:0xb DW_TAG_formal_parameter
253	.byte	2                               # DW_AT_location
254	.byte	145
255	.byte	120
256	.byte	0                               # DW_AT_name
257	.byte	1                               # DW_AT_decl_file
258	.byte	2                               # DW_AT_decl_line
259	.long	124                             # DW_AT_type
260	.byte	5                               # Abbrev [5] 0x4a:0xb DW_TAG_formal_parameter
261	.byte	2                               # DW_AT_location
262	.byte	145
263	.byte	112
264	.byte	2                               # DW_AT_name
265	.byte	1                               # DW_AT_decl_file
266	.byte	2                               # DW_AT_decl_line
267	.long	124                             # DW_AT_type
268	.byte	0                               # End Of Children Mark
269	.byte	6                               # Abbrev [6] 0x56:0x26 DW_TAG_subprogram
270	.byte	3                               # DW_AT_low_pc
271	.long	.Lfunc_end1-.Lfunc_begin1       # DW_AT_high_pc
272	.byte	1                               # DW_AT_frame_base
273	.byte	86
274	.byte	5                               # DW_AT_name
275	.byte	1                               # DW_AT_decl_file
276	.byte	9                               # DW_AT_decl_line
277	.long	36                              # DW_AT_type
278                                        # DW_AT_external
279	.byte	5                               # Abbrev [5] 0x65:0xb DW_TAG_formal_parameter
280	.byte	2                               # DW_AT_location
281	.byte	145
282	.byte	120
283	.byte	6                               # DW_AT_name
284	.byte	1                               # DW_AT_decl_file
285	.byte	9                               # DW_AT_decl_line
286	.long	36                              # DW_AT_type
287	.byte	5                               # Abbrev [5] 0x70:0xb DW_TAG_formal_parameter
288	.byte	2                               # DW_AT_location
289	.byte	145
290	.byte	112
291	.byte	7                               # DW_AT_name
292	.byte	1                               # DW_AT_decl_file
293	.byte	9                               # DW_AT_decl_line
294	.long	129                             # DW_AT_type
295	.byte	0                               # End Of Children Mark
296	.byte	7                               # Abbrev [7] 0x7c:0x5 DW_TAG_pointer_type
297	.long	36                              # DW_AT_type
298	.byte	7                               # Abbrev [7] 0x81:0x5 DW_TAG_pointer_type
299	.long	134                             # DW_AT_type
300	.byte	7                               # Abbrev [7] 0x86:0x5 DW_TAG_pointer_type
301	.long	139                             # DW_AT_type
302	.byte	3                               # Abbrev [3] 0x8b:0x4 DW_TAG_base_type
303	.byte	8                               # DW_AT_name
304	.byte	6                               # DW_AT_encoding
305	.byte	1                               # DW_AT_byte_size
306	.byte	0                               # End Of Children Mark
307.Ldebug_info_dwo_end0:
308	.section	.debug_abbrev.dwo,"e",@progbits
309	.byte	1                               # Abbreviation Code
310	.byte	17                              # DW_TAG_compile_unit
311	.byte	1                               # DW_CHILDREN_yes
312	.byte	37                              # DW_AT_producer
313	.ascii	"\202>"                         # DW_FORM_GNU_str_index
314	.byte	19                              # DW_AT_language
315	.byte	5                               # DW_FORM_data2
316	.byte	3                               # DW_AT_name
317	.ascii	"\202>"                         # DW_FORM_GNU_str_index
318	.ascii	"\260B"                         # DW_AT_GNU_dwo_name
319	.ascii	"\202>"                         # DW_FORM_GNU_str_index
320	.ascii	"\261B"                         # DW_AT_GNU_dwo_id
321	.byte	7                               # DW_FORM_data8
322	.byte	0                               # EOM(1)
323	.byte	0                               # EOM(2)
324	.byte	2                               # Abbreviation Code
325	.byte	52                              # DW_TAG_variable
326	.byte	0                               # DW_CHILDREN_no
327	.byte	3                               # DW_AT_name
328	.ascii	"\202>"                         # DW_FORM_GNU_str_index
329	.byte	73                              # DW_AT_type
330	.byte	19                              # DW_FORM_ref4
331	.byte	63                              # DW_AT_external
332	.byte	25                              # DW_FORM_flag_present
333	.byte	58                              # DW_AT_decl_file
334	.byte	11                              # DW_FORM_data1
335	.byte	59                              # DW_AT_decl_line
336	.byte	11                              # DW_FORM_data1
337	.byte	2                               # DW_AT_location
338	.byte	24                              # DW_FORM_exprloc
339	.byte	0                               # EOM(1)
340	.byte	0                               # EOM(2)
341	.byte	3                               # Abbreviation Code
342	.byte	36                              # DW_TAG_base_type
343	.byte	0                               # DW_CHILDREN_no
344	.byte	3                               # DW_AT_name
345	.ascii	"\202>"                         # DW_FORM_GNU_str_index
346	.byte	62                              # DW_AT_encoding
347	.byte	11                              # DW_FORM_data1
348	.byte	11                              # DW_AT_byte_size
349	.byte	11                              # DW_FORM_data1
350	.byte	0                               # EOM(1)
351	.byte	0                               # EOM(2)
352	.byte	4                               # Abbreviation Code
353	.byte	46                              # DW_TAG_subprogram
354	.byte	1                               # DW_CHILDREN_yes
355	.byte	17                              # DW_AT_low_pc
356	.ascii	"\201>"                         # DW_FORM_GNU_addr_index
357	.byte	18                              # DW_AT_high_pc
358	.byte	6                               # DW_FORM_data4
359	.byte	64                              # DW_AT_frame_base
360	.byte	24                              # DW_FORM_exprloc
361	.byte	110                             # DW_AT_linkage_name
362	.ascii	"\202>"                         # DW_FORM_GNU_str_index
363	.byte	3                               # DW_AT_name
364	.ascii	"\202>"                         # DW_FORM_GNU_str_index
365	.byte	58                              # DW_AT_decl_file
366	.byte	11                              # DW_FORM_data1
367	.byte	59                              # DW_AT_decl_line
368	.byte	11                              # DW_FORM_data1
369	.byte	63                              # DW_AT_external
370	.byte	25                              # DW_FORM_flag_present
371	.byte	0                               # EOM(1)
372	.byte	0                               # EOM(2)
373	.byte	5                               # Abbreviation Code
374	.byte	5                               # DW_TAG_formal_parameter
375	.byte	0                               # DW_CHILDREN_no
376	.byte	2                               # DW_AT_location
377	.byte	24                              # DW_FORM_exprloc
378	.byte	3                               # DW_AT_name
379	.ascii	"\202>"                         # DW_FORM_GNU_str_index
380	.byte	58                              # DW_AT_decl_file
381	.byte	11                              # DW_FORM_data1
382	.byte	59                              # DW_AT_decl_line
383	.byte	11                              # DW_FORM_data1
384	.byte	73                              # DW_AT_type
385	.byte	19                              # DW_FORM_ref4
386	.byte	0                               # EOM(1)
387	.byte	0                               # EOM(2)
388	.byte	6                               # Abbreviation Code
389	.byte	46                              # DW_TAG_subprogram
390	.byte	1                               # DW_CHILDREN_yes
391	.byte	17                              # DW_AT_low_pc
392	.ascii	"\201>"                         # DW_FORM_GNU_addr_index
393	.byte	18                              # DW_AT_high_pc
394	.byte	6                               # DW_FORM_data4
395	.byte	64                              # DW_AT_frame_base
396	.byte	24                              # DW_FORM_exprloc
397	.byte	3                               # DW_AT_name
398	.ascii	"\202>"                         # DW_FORM_GNU_str_index
399	.byte	58                              # DW_AT_decl_file
400	.byte	11                              # DW_FORM_data1
401	.byte	59                              # DW_AT_decl_line
402	.byte	11                              # DW_FORM_data1
403	.byte	73                              # DW_AT_type
404	.byte	19                              # DW_FORM_ref4
405	.byte	63                              # DW_AT_external
406	.byte	25                              # DW_FORM_flag_present
407	.byte	0                               # EOM(1)
408	.byte	0                               # EOM(2)
409	.byte	7                               # Abbreviation Code
410	.byte	15                              # DW_TAG_pointer_type
411	.byte	0                               # DW_CHILDREN_no
412	.byte	73                              # DW_AT_type
413	.byte	19                              # DW_FORM_ref4
414	.byte	0                               # EOM(1)
415	.byte	0                               # EOM(2)
416	.byte	0                               # EOM(3)
417	.section	.debug_addr,"",@progbits
418.Laddr_table_base0:
419	.quad	x
420	.quad	y
421	.quad	.Lfunc_begin0
422	.quad	.Lfunc_begin1
423	.section	.debug_gnu_pubnames,"",@progbits
424	.long	.LpubNames_end0-.LpubNames_start0 # Length of Public Names Info
425.LpubNames_start0:
426	.short	2                               # DWARF Version
427	.long	.Lcu_begin0                     # Offset of Compilation Unit Info
428	.long	48                              # Compilation Unit Length
429	.long	86                              # DIE offset
430	.byte	48                              # Attributes: FUNCTION, EXTERNAL
431	.asciz	"main"                          # External Name
432	.long	25                              # DIE offset
433	.byte	32                              # Attributes: VARIABLE, EXTERNAL
434	.asciz	"x"                             # External Name
435	.long	40                              # DIE offset
436	.byte	32                              # Attributes: VARIABLE, EXTERNAL
437	.asciz	"y"                             # External Name
438	.long	51                              # DIE offset
439	.byte	48                              # Attributes: FUNCTION, EXTERNAL
440	.asciz	"use"                           # External Name
441	.long	0                               # End Mark
442.LpubNames_end0:
443	.section	.debug_gnu_pubtypes,"",@progbits
444	.long	.LpubTypes_end0-.LpubTypes_start0 # Length of Public Types Info
445.LpubTypes_start0:
446	.short	2                               # DWARF Version
447	.long	.Lcu_begin0                     # Offset of Compilation Unit Info
448	.long	48                              # Compilation Unit Length
449	.long	36                              # DIE offset
450	.byte	144                             # Attributes: TYPE, STATIC
451	.asciz	"int"                           # External Name
452	.long	139                             # DIE offset
453	.byte	144                             # Attributes: TYPE, STATIC
454	.asciz	"char"                          # External Name
455	.long	0                               # End Mark
456.LpubTypes_end0:
457	.ident	"clang version 15.0.0"
458	.section	".note.GNU-stack","",@progbits
459	.addrsig
460	.addrsig_sym _Z3usePiS_
461	.addrsig_sym _Z6helperi
462	.addrsig_sym x
463	.addrsig_sym y
464	.section	.debug_line,"",@progbits
465.Lline_table_start0:
466