xref: /llvm-project/lld/test/ELF/debug-names-dwarf64.s (revision 16711b431b843dd2143d38fdf6b0591dfb1783e0)
1# REQUIRES: x86
2# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
3# RUN: not ld.lld --debug-names %t.o -o /dev/null 2>&1 | \
4# RUN:   FileCheck -DFILE=%t.o --implicit-check-not=error: %s
5
6# CHECK: error: [[FILE]]:(.debug_names): found DWARF64, which is currently unsupported
7
8.ifdef GEN
9//--- a.cc
10struct t1 {};
11extern "C" void _start(t1) {}
12//--- gen
13clang --target=x86_64-linux -S -g -gpubnames -gdwarf64 a.cc -o -
14.endif
15	.text
16	.file	"a.cc"
17	.globl	_start                          # -- Begin function _start
18	.p2align	4, 0x90
19	.type	_start,@function
20_start:                                 # @_start
21.Lfunc_begin0:
22	.file	0 "/proc/self/cwd" "a.cc" md5 0x6835f89a7d36054002b51e54e47d852e
23	.loc	0 2 0                           # a.cc:2:0
24	.cfi_startproc
25# %bb.0:                                # %entry
26	pushq	%rbp
27	.cfi_def_cfa_offset 16
28	.cfi_offset %rbp, -16
29	movq	%rsp, %rbp
30	.cfi_def_cfa_register %rbp
31.Ltmp0:
32	.loc	0 2 29 prologue_end epilogue_begin # a.cc:2:29
33	popq	%rbp
34	.cfi_def_cfa %rsp, 8
35	retq
36.Ltmp1:
37.Lfunc_end0:
38	.size	_start, .Lfunc_end0-_start
39	.cfi_endproc
40                                        # -- End function
41	.section	.debug_abbrev,"",@progbits
42	.byte	1                               # Abbreviation Code
43	.byte	17                              # DW_TAG_compile_unit
44	.byte	1                               # DW_CHILDREN_yes
45	.byte	37                              # DW_AT_producer
46	.byte	37                              # DW_FORM_strx1
47	.byte	19                              # DW_AT_language
48	.byte	5                               # DW_FORM_data2
49	.byte	3                               # DW_AT_name
50	.byte	37                              # DW_FORM_strx1
51	.byte	114                             # DW_AT_str_offsets_base
52	.byte	23                              # DW_FORM_sec_offset
53	.byte	16                              # DW_AT_stmt_list
54	.byte	23                              # DW_FORM_sec_offset
55	.byte	27                              # DW_AT_comp_dir
56	.byte	37                              # DW_FORM_strx1
57	.byte	17                              # DW_AT_low_pc
58	.byte	27                              # DW_FORM_addrx
59	.byte	18                              # DW_AT_high_pc
60	.byte	6                               # DW_FORM_data4
61	.byte	115                             # DW_AT_addr_base
62	.byte	23                              # DW_FORM_sec_offset
63	.byte	0                               # EOM(1)
64	.byte	0                               # EOM(2)
65	.byte	2                               # Abbreviation Code
66	.byte	46                              # DW_TAG_subprogram
67	.byte	1                               # DW_CHILDREN_yes
68	.byte	17                              # DW_AT_low_pc
69	.byte	27                              # DW_FORM_addrx
70	.byte	18                              # DW_AT_high_pc
71	.byte	6                               # DW_FORM_data4
72	.byte	64                              # DW_AT_frame_base
73	.byte	24                              # DW_FORM_exprloc
74	.byte	3                               # DW_AT_name
75	.byte	37                              # DW_FORM_strx1
76	.byte	58                              # DW_AT_decl_file
77	.byte	11                              # DW_FORM_data1
78	.byte	59                              # DW_AT_decl_line
79	.byte	11                              # DW_FORM_data1
80	.byte	63                              # DW_AT_external
81	.byte	25                              # DW_FORM_flag_present
82	.byte	0                               # EOM(1)
83	.byte	0                               # EOM(2)
84	.byte	3                               # Abbreviation Code
85	.byte	5                               # DW_TAG_formal_parameter
86	.byte	0                               # DW_CHILDREN_no
87	.byte	2                               # DW_AT_location
88	.byte	24                              # DW_FORM_exprloc
89	.byte	58                              # DW_AT_decl_file
90	.byte	11                              # DW_FORM_data1
91	.byte	59                              # DW_AT_decl_line
92	.byte	11                              # DW_FORM_data1
93	.byte	73                              # DW_AT_type
94	.byte	19                              # DW_FORM_ref4
95	.byte	0                               # EOM(1)
96	.byte	0                               # EOM(2)
97	.byte	4                               # Abbreviation Code
98	.byte	19                              # DW_TAG_structure_type
99	.byte	0                               # DW_CHILDREN_no
100	.byte	54                              # DW_AT_calling_convention
101	.byte	11                              # DW_FORM_data1
102	.byte	3                               # DW_AT_name
103	.byte	37                              # DW_FORM_strx1
104	.byte	11                              # DW_AT_byte_size
105	.byte	11                              # DW_FORM_data1
106	.byte	58                              # DW_AT_decl_file
107	.byte	11                              # DW_FORM_data1
108	.byte	59                              # DW_AT_decl_line
109	.byte	11                              # DW_FORM_data1
110	.byte	0                               # EOM(1)
111	.byte	0                               # EOM(2)
112	.byte	0                               # EOM(3)
113	.section	.debug_info,"",@progbits
114.Lcu_begin0:
115	.long	4294967295                      # DWARF64 Mark
116	.quad	.Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit
117.Ldebug_info_start0:
118	.short	5                               # DWARF version number
119	.byte	1                               # DWARF Unit Type
120	.byte	8                               # Address Size (in bytes)
121	.quad	.debug_abbrev                   # Offset Into Abbrev. Section
122	.byte	1                               # Abbrev [1] 0x18:0x40 DW_TAG_compile_unit
123	.byte	0                               # DW_AT_producer
124	.short	33                              # DW_AT_language
125	.byte	1                               # DW_AT_name
126	.quad	.Lstr_offsets_base0             # DW_AT_str_offsets_base
127	.quad	.Lline_table_start0             # DW_AT_stmt_list
128	.byte	2                               # DW_AT_comp_dir
129	.byte	0                               # DW_AT_low_pc
130	.long	.Lfunc_end0-.Lfunc_begin0       # DW_AT_high_pc
131	.quad	.Laddr_table_base0              # DW_AT_addr_base
132	.byte	2                               # Abbrev [2] 0x3b:0x16 DW_TAG_subprogram
133	.byte	0                               # DW_AT_low_pc
134	.long	.Lfunc_end0-.Lfunc_begin0       # DW_AT_high_pc
135	.byte	1                               # DW_AT_frame_base
136	.byte	86
137	.byte	3                               # DW_AT_name
138	.byte	0                               # DW_AT_decl_file
139	.byte	2                               # DW_AT_decl_line
140                                        # DW_AT_external
141	.byte	3                               # Abbrev [3] 0x46:0xa DW_TAG_formal_parameter
142	.byte	2                               # DW_AT_location
143	.byte	145
144	.byte	127
145	.byte	0                               # DW_AT_decl_file
146	.byte	2                               # DW_AT_decl_line
147	.long	81                              # DW_AT_type
148	.byte	0                               # End Of Children Mark
149	.byte	4                               # Abbrev [4] 0x51:0x6 DW_TAG_structure_type
150	.byte	5                               # DW_AT_calling_convention
151	.byte	4                               # DW_AT_name
152	.byte	1                               # DW_AT_byte_size
153	.byte	0                               # DW_AT_decl_file
154	.byte	1                               # DW_AT_decl_line
155	.byte	0                               # End Of Children Mark
156.Ldebug_info_end0:
157	.section	.debug_str_offsets,"",@progbits
158	.long	4294967295                      # DWARF64 Mark
159	.quad	44                              # Length of String Offsets Set
160	.short	5
161	.short	0
162.Lstr_offsets_base0:
163	.section	.debug_str,"MS",@progbits,1
164.Linfo_string0:
165	.byte	0                               # string offset=0
166.Linfo_string1:
167	.asciz	"a.cc"                          # string offset=1
168.Linfo_string2:
169	.asciz	"/proc/self/cwd"                # string offset=6
170.Linfo_string3:
171	.asciz	"_start"                        # string offset=21
172.Linfo_string4:
173	.asciz	"t1"                            # string offset=28
174	.section	.debug_str_offsets,"",@progbits
175	.quad	.Linfo_string0
176	.quad	.Linfo_string1
177	.quad	.Linfo_string2
178	.quad	.Linfo_string3
179	.quad	.Linfo_string4
180	.section	.debug_addr,"",@progbits
181	.long	4294967295                      # DWARF64 Mark
182	.quad	.Ldebug_addr_end0-.Ldebug_addr_start0 # Length of contribution
183.Ldebug_addr_start0:
184	.short	5                               # DWARF version number
185	.byte	8                               # Address size
186	.byte	0                               # Segment selector size
187.Laddr_table_base0:
188	.quad	.Lfunc_begin0
189.Ldebug_addr_end0:
190	.section	.debug_names,"",@progbits
191	.long	4294967295                      # DWARF64 Mark
192	.quad	.Lnames_end0-.Lnames_start0     # Header: unit length
193.Lnames_start0:
194	.short	5                               # Header: version
195	.short	0                               # Header: padding
196	.long	1                               # Header: compilation unit count
197	.long	0                               # Header: local type unit count
198	.long	0                               # Header: foreign type unit count
199	.long	2                               # Header: bucket count
200	.long	2                               # Header: name count
201	.long	.Lnames_abbrev_end0-.Lnames_abbrev_start0 # Header: abbreviation table size
202	.long	8                               # Header: augmentation string size
203	.ascii	"LLVM0700"                      # Header: augmentation string
204	.quad	.Lcu_begin0                     # Compilation unit 0
205	.long	1                               # Bucket 0
206	.long	0                               # Bucket 1
207	.long	5863786                         # Hash in Bucket 0
208	.long	-304389582                      # Hash in Bucket 0
209	.quad	.Linfo_string4                  # String in Bucket 0: t1
210	.quad	.Linfo_string3                  # String in Bucket 0: _start
211	.quad	.Lnames1-.Lnames_entries0       # Offset in Bucket 0
212	.quad	.Lnames0-.Lnames_entries0       # Offset in Bucket 0
213.Lnames_abbrev_start0:
214	.byte	1                               # Abbrev code
215	.byte	19                              # DW_TAG_structure_type
216	.byte	3                               # DW_IDX_die_offset
217	.byte	19                              # DW_FORM_ref4
218	.byte	4                               # DW_IDX_parent
219	.byte	25                              # DW_FORM_flag_present
220	.byte	0                               # End of abbrev
221	.byte	0                               # End of abbrev
222	.byte	2                               # Abbrev code
223	.byte	46                              # DW_TAG_subprogram
224	.byte	3                               # DW_IDX_die_offset
225	.byte	19                              # DW_FORM_ref4
226	.byte	4                               # DW_IDX_parent
227	.byte	25                              # DW_FORM_flag_present
228	.byte	0                               # End of abbrev
229	.byte	0                               # End of abbrev
230	.byte	0                               # End of abbrev list
231.Lnames_abbrev_end0:
232.Lnames_entries0:
233.Lnames1:
234.L1:
235	.byte	1                               # Abbreviation code
236	.long	81                              # DW_IDX_die_offset
237	.byte	0                               # DW_IDX_parent
238                                        # End of list: t1
239.Lnames0:
240.L0:
241	.byte	2                               # Abbreviation code
242	.long	59                              # DW_IDX_die_offset
243	.byte	0                               # DW_IDX_parent
244                                        # End of list: _start
245	.p2align	2, 0x0
246.Lnames_end0:
247	.section	".note.GNU-stack","",@progbits
248	.addrsig
249	.section	.debug_line,"",@progbits
250.Lline_table_start0:
251