xref: /llvm-project/llvm/test/tools/llvm-objdump/X86/function-sections-line-numbers.s (revision 6ed18eaa777beac510272c73e3889d9ec54ad341)
1# The code below is the reduced version of the output
2# from the following invocation and source:
3#
4# // test.cpp:
5#void f1() {}
6#void f2() {}
7#
8# clang -gdwarf-5 -ffunction-sections test.cpp -o test.s -S
9
10# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux -dwarf-version=5 %s -o %t.o
11# RUN: llvm-objdump -d --line-numbers -r -s --section-headers -t %t.o | FileCheck %s
12
13
14# CHECK: 0000000000000000 <_Z2f1v>
15# CHECK-NOT: test.cpp:2
16# CHECK: test.cpp:1
17# CHECK-NOT: test.cpp:2
18# CHECK: 0000000000000000 <_Z2f2v>
19# CHECK-NOT: test.cpp:1
20# CHECK: test.cpp:2
21# CHECK-NOT: test.cpp:1
22
23
24	.text
25	.file	"test.cpp"
26	.section	.text._Z2f1v,"ax",@progbits
27	.globl	_Z2f1v                  # -- Begin function _Z2f1v
28	.p2align	4, 0x90
29	.type	_Z2f1v,@function
30_Z2f1v:                                 # @_Z2f1v
31.Lfunc_begin0:
32	.file	0 "/home/avl" "test.cpp" md5 0xefae234cc05b45384d782316d3a5d338
33	.loc	0 1 0                   # test.cpp:1:0
34	.cfi_startproc
35# %bb.0:                                # %entry
36	pushq	%rbp
37	.cfi_def_cfa_offset 16
38	.cfi_offset %rbp, -16
39	movq	%rsp, %rbp
40	.cfi_def_cfa_register %rbp
41.Ltmp0:
42	.loc	0 1 12 prologue_end     # test.cpp:1:12
43	popq	%rbp
44	.cfi_def_cfa %rsp, 8
45	retq
46.Ltmp1:
47.Lfunc_end0:
48	.size	_Z2f1v, .Lfunc_end0-_Z2f1v
49	.cfi_endproc
50                                        # -- End function
51	.section	.text._Z2f2v,"ax",@progbits
52	.globl	_Z2f2v                  # -- Begin function _Z2f2v
53	.p2align	4, 0x90
54	.type	_Z2f2v,@function
55_Z2f2v:                                 # @_Z2f2v
56.Lfunc_begin1:
57	.loc	0 2 0                   # test.cpp:2:0
58	.cfi_startproc
59# %bb.0:                                # %entry
60	pushq	%rbp
61	.cfi_def_cfa_offset 16
62	.cfi_offset %rbp, -16
63	movq	%rsp, %rbp
64	.cfi_def_cfa_register %rbp
65.Ltmp2:
66	.loc	0 2 12 prologue_end     # test.cpp:2:12
67	popq	%rbp
68	.cfi_def_cfa %rsp, 8
69	retq
70.Ltmp3:
71.Lfunc_end1:
72	.size	_Z2f2v, .Lfunc_end1-_Z2f2v
73	.cfi_endproc
74                                        # -- End function
75	.section	.debug_str_offsets,"",@progbits
76	.long	32
77	.short	5
78	.short	0
79.Lstr_offsets_base0:
80	.section	.debug_str,"MS",@progbits,1
81.Linfo_string0:
82	.asciz	"clang version 9.0.0 (https://github.com/llvm/llvm-project.git ebfc1e5af7a65381d858612517e6414ef58df482)" # string offset=0
83.Linfo_string1:
84	.asciz	"test.cpp"              # string offset=104
85.Linfo_string2:
86	.asciz	"/home/avl"             # string offset=113
87.Linfo_string3:
88	.asciz	"_Z2f1v"                # string offset=123
89.Linfo_string4:
90	.asciz	"f1"                    # string offset=130
91.Linfo_string5:
92	.asciz	"_Z2f2v"                # string offset=133
93.Linfo_string6:
94	.asciz	"f2"                    # string offset=140
95	.section	.debug_str_offsets,"",@progbits
96	.long	.Linfo_string0
97	.long	.Linfo_string1
98	.long	.Linfo_string2
99	.long	.Linfo_string3
100	.long	.Linfo_string4
101	.long	.Linfo_string5
102	.long	.Linfo_string6
103	.section	.debug_abbrev,"",@progbits
104	.byte	1                       # Abbreviation Code
105	.byte	17                      # DW_TAG_compile_unit
106	.byte	1                       # DW_CHILDREN_yes
107	.byte	37                      # DW_AT_producer
108	.byte	37                      # DW_FORM_strx1
109	.byte	19                      # DW_AT_language
110	.byte	5                       # DW_FORM_data2
111	.byte	3                       # DW_AT_name
112	.byte	37                      # DW_FORM_strx1
113	.byte	114                     # DW_AT_str_offsets_base
114	.byte	23                      # DW_FORM_sec_offset
115	.byte	16                      # DW_AT_stmt_list
116	.byte	23                      # DW_FORM_sec_offset
117	.byte	27                      # DW_AT_comp_dir
118	.byte	37                      # DW_FORM_strx1
119	.byte	115                     # DW_AT_addr_base
120	.byte	23                      # DW_FORM_sec_offset
121	.byte	17                      # DW_AT_low_pc
122	.byte	1                       # DW_FORM_addr
123	.byte	85                      # DW_AT_ranges
124	.byte	35                      # DW_FORM_rnglistx
125	.byte	116                     # DW_AT_rnglists_base
126	.byte	23                      # DW_FORM_sec_offset
127	.byte	0                       # EOM(1)
128	.byte	0                       # EOM(2)
129	.byte	2                       # Abbreviation Code
130	.byte	46                      # DW_TAG_subprogram
131	.byte	0                       # DW_CHILDREN_no
132	.byte	17                      # DW_AT_low_pc
133	.byte	27                      # DW_FORM_addrx
134	.byte	18                      # DW_AT_high_pc
135	.byte	6                       # DW_FORM_data4
136	.byte	64                      # DW_AT_frame_base
137	.byte	24                      # DW_FORM_exprloc
138	.byte	110                     # DW_AT_linkage_name
139	.byte	37                      # DW_FORM_strx1
140	.byte	3                       # DW_AT_name
141	.byte	37                      # DW_FORM_strx1
142	.byte	58                      # DW_AT_decl_file
143	.byte	11                      # DW_FORM_data1
144	.byte	59                      # DW_AT_decl_line
145	.byte	11                      # DW_FORM_data1
146	.byte	63                      # DW_AT_external
147	.byte	25                      # DW_FORM_flag_present
148	.byte	0                       # EOM(1)
149	.byte	0                       # EOM(2)
150	.byte	0                       # EOM(3)
151	.section	.debug_info,"",@progbits
152.Lcu_begin0:
153	.long	.Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit
154.Ldebug_info_start0:
155	.short	5                       # DWARF version number
156	.byte	1                       # DWARF Unit Type
157	.byte	8                       # Address Size (in bytes)
158	.long	.debug_abbrev           # Offset Into Abbrev. Section
159	.byte	1                       # Abbrev [1] 0xc:0x38 DW_TAG_compile_unit
160	.byte	0                       # DW_AT_producer
161	.short	4                       # DW_AT_language
162	.byte	1                       # DW_AT_name
163	.long	.Lstr_offsets_base0     # DW_AT_str_offsets_base
164	.long	.Lline_table_start0     # DW_AT_stmt_list
165	.byte	2                       # DW_AT_comp_dir
166	.long	.Laddr_table_base0      # DW_AT_addr_base
167	.quad	0                       # DW_AT_low_pc
168	.byte	0                       # DW_AT_ranges
169	.long	.Lrnglists_table_base0  # DW_AT_rnglists_base
170	.byte	2                       # Abbrev [2] 0x2b:0xc DW_TAG_subprogram
171	.byte	0                       # DW_AT_low_pc
172	.long	.Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc
173	.byte	1                       # DW_AT_frame_base
174	.byte	86
175	.byte	3                       # DW_AT_linkage_name
176	.byte	4                       # DW_AT_name
177	.byte	1                       # DW_AT_decl_file
178	.byte	1                       # DW_AT_decl_line
179                                        # DW_AT_external
180	.byte	2                       # Abbrev [2] 0x37:0xc DW_TAG_subprogram
181	.byte	1                       # DW_AT_low_pc
182	.long	.Lfunc_end1-.Lfunc_begin1 # DW_AT_high_pc
183	.byte	1                       # DW_AT_frame_base
184	.byte	86
185	.byte	5                       # DW_AT_linkage_name
186	.byte	6                       # DW_AT_name
187	.byte	1                       # DW_AT_decl_file
188	.byte	2                       # DW_AT_decl_line
189                                        # DW_AT_external
190	.byte	0                       # End Of Children Mark
191.Ldebug_info_end0:
192	.section	.debug_rnglists,"",@progbits
193	.long	.Ldebug_rnglist_table_end0-.Ldebug_rnglist_table_start0 # Length
194.Ldebug_rnglist_table_start0:
195	.short	5                       # Version
196	.byte	8                       # Address size
197	.byte	0                       # Segment selector size
198	.long	1                       # Offset entry count
199.Lrnglists_table_base0:
200	.long	.Ldebug_ranges0-.Lrnglists_table_base0
201.Ldebug_ranges0:
202	.byte	3                       # DW_RLE_startx_length
203	.byte	0                       #   start index
204	.uleb128 .Lfunc_end0-.Lfunc_begin0 #   length
205	.byte	3                       # DW_RLE_startx_length
206	.byte	1                       #   start index
207	.uleb128 .Lfunc_end1-.Lfunc_begin1 #   length
208	.byte	0                       # DW_RLE_end_of_list
209.Ldebug_rnglist_table_end0:
210.Ldebug_addr_start0:
211	.short	5                       # DWARF version number
212	.byte	8                       # Address size
213	.byte	0                       # Segment selector size
214.Laddr_table_base0:
215	.quad	.Lfunc_begin0
216	.quad	.Lfunc_begin1
217.Ldebug_addr_end0:
218
219	.section	.debug_line,"",@progbits
220.Lline_table_start0:
221