xref: /llvm-project/llvm/test/tools/llvm-dwarfdump/X86/debug_loclists_unused_invalid.s (revision 9670a45c980c371c5ece8047a00b8b2abec73823)
1# REQUIRES: x86-registered-target
2
3# RUN: rm -rf %t
4# RUN: mkdir %t
5# RUN: cd %t
6# RUN: llvm-mc %s -dwarf-version=5 -filetype obj -triple x86_64-pc-linux -o main.o
7# RUN: llvm-dwarfdump main.o 2>&1 | FileCheck %s
8
9# CHECK: .debug_info.dwo contents:
10# CHECK-NEXT: Compile Unit:
11# CHECK-EMPTY:
12# CHECK-NEXT: compile_unit
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 "/usr/local/google/home/blaikie/dev/scratch" "main.cpp" md5 0x277b2d67900f5d0f46c9638ad2528ff1
22	.loc	0 1 0                           # main.cpp:1:0
23	.cfi_startproc
24# %bb.0:                                # %entry
25	pushq	%rbp
26	.cfi_def_cfa_offset 16
27	.cfi_offset %rbp, -16
28	movq	%rsp, %rbp
29	.cfi_def_cfa_register %rbp
30	xorl	%eax, %eax
31.Ltmp0:
32	.loc	0 2 1 prologue_end              # main.cpp:2:1
33	popq	%rbp
34	.cfi_def_cfa %rsp, 8
35	retq
36.Ltmp1:
37.Lfunc_end0:
38	.size	main, .Lfunc_end0-main
39	.cfi_endproc
40                                        # -- End function
41	.section	.debug_abbrev,"",@progbits
42	.byte	1                               # Abbreviation Code
43	.byte	74                              # DW_TAG_skeleton_unit
44	.byte	0                               # DW_CHILDREN_no
45	.byte	16                              # DW_AT_stmt_list
46	.byte	23                              # DW_FORM_sec_offset
47	.byte	114                             # DW_AT_str_offsets_base
48	.byte	23                              # DW_FORM_sec_offset
49	.byte	27                              # DW_AT_comp_dir
50	.byte	37                              # DW_FORM_strx1
51	.ascii	"\264B"                         # DW_AT_GNU_pubnames
52	.byte	25                              # DW_FORM_flag_present
53	.byte	118                             # DW_AT_dwo_name
54	.byte	37                              # DW_FORM_strx1
55	.byte	17                              # DW_AT_low_pc
56	.byte	27                              # DW_FORM_addrx
57	.byte	18                              # DW_AT_high_pc
58	.byte	6                               # DW_FORM_data4
59	.byte	115                             # DW_AT_addr_base
60	.byte	23                              # DW_FORM_sec_offset
61	.byte	0                               # EOM(1)
62	.byte	0                               # EOM(2)
63	.byte	0                               # EOM(3)
64	.section	.debug_info,"",@progbits
65.Lcu_begin0:
66	.long	.Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit
67.Ldebug_info_start0:
68	.short	5                               # DWARF version number
69	.byte	4                               # DWARF Unit Type
70	.byte	8                               # Address Size (in bytes)
71	.long	.debug_abbrev                   # Offset Into Abbrev. Section
72	.quad	6318074710904753300
73	.byte	1                               # Abbrev [1] 0x14:0x14 DW_TAG_skeleton_unit
74	.long	.Lline_table_start0             # DW_AT_stmt_list
75	.long	.Lstr_offsets_base0             # DW_AT_str_offsets_base
76	.byte	0                               # DW_AT_comp_dir
77                                        # DW_AT_GNU_pubnames
78	.byte	1                               # DW_AT_dwo_name
79	.byte	0                               # DW_AT_low_pc
80	.long	.Lfunc_end0-.Lfunc_begin0       # DW_AT_high_pc
81	.long	.Laddr_table_base0              # DW_AT_addr_base
82.Ldebug_info_end0:
83	.section	.debug_str_offsets,"",@progbits
84	.long	12                              # Length of String Offsets Set
85	.short	5
86	.short	0
87.Lstr_offsets_base0:
88	.section	.debug_str,"MS",@progbits,1
89.Lskel_string0:
90	.asciz	"" # string offset=0
91.Lskel_string1:
92	.asciz	"main.o"                        # string offset=43
93	.section	.debug_str_offsets,"",@progbits
94	.long	.Lskel_string0
95	.long	.Lskel_string1
96	.section	.debug_str_offsets.dwo,"e",@progbits
97	.long	24                              # Length of String Offsets Set
98	.short	5
99	.short	0
100	.section	.debug_str.dwo,"eMS",@progbits,1
101.Linfo_string0:
102	.asciz	"main"                          # string offset=0
103.Linfo_string1:
104	.asciz	"int"                           # string offset=5
105.Linfo_string2:
106	.asciz	"clang version 12.0.0 (git@github.com:llvm/llvm-project.git 9a33f027ac7d73e14ae287e78ab554142d1cbc8f)" # string offset=9
107.Linfo_string3:
108	.asciz	"main.cpp"                      # string offset=110
109.Linfo_string4:
110	.asciz	"main.s"                        # string offset=119
111	.section	.debug_str_offsets.dwo,"e",@progbits
112	.long	0
113	.long	5
114	.long	9
115	.long	110
116	.long	119
117	.section	.debug_info.dwo,"e",@progbits
118	.long	.Ldebug_info_dwo_end0-.Ldebug_info_dwo_start0 # Length of Unit
119.Ldebug_info_dwo_start0:
120	.short	5                               # DWARF version number
121	.byte	5                               # DWARF Unit Type
122	.byte	8                               # Address Size (in bytes)
123	.long	0                               # Offset Into Abbrev. Section
124	.quad	6318074710904753300
125	.byte	1                               # Abbrev [1] 0x14:0x1a DW_TAG_compile_unit
126	.byte	2                               # DW_AT_producer
127	.short	33                              # DW_AT_language
128	.byte	3                               # DW_AT_name
129	.byte	4                               # DW_AT_dwo_name
130	.byte	2                               # Abbrev [2] 0x1a:0xf DW_TAG_subprogram
131	.byte	0                               # DW_AT_low_pc
132	.long	.Lfunc_end0-.Lfunc_begin0       # DW_AT_high_pc
133	.byte	1                               # DW_AT_frame_base
134	.byte	86
135	.byte	0                               # DW_AT_name
136	.byte	0                               # DW_AT_decl_file
137	.byte	1                               # DW_AT_decl_line
138	.long	41                              # DW_AT_type
139                                        # DW_AT_external
140	.byte	3                               # Abbrev [3] 0x29:0x4 DW_TAG_base_type
141	.byte	1                               # DW_AT_name
142	.byte	5                               # DW_AT_encoding
143	.byte	4                               # DW_AT_byte_size
144	.byte	0                               # End Of Children Mark
145.Ldebug_info_dwo_end0:
146	.section	.debug_abbrev.dwo,"e",@progbits
147	.byte	1                               # Abbreviation Code
148	.byte	17                              # DW_TAG_compile_unit
149	.byte	1                               # DW_CHILDREN_yes
150	.byte	37                              # DW_AT_producer
151	.byte	37                              # DW_FORM_strx1
152	.byte	19                              # DW_AT_language
153	.byte	5                               # DW_FORM_data2
154	.byte	3                               # DW_AT_name
155	.byte	37                              # DW_FORM_strx1
156	.byte	118                             # DW_AT_dwo_name
157	.byte	37                              # DW_FORM_strx1
158	.byte	0                               # EOM(1)
159	.byte	0                               # EOM(2)
160	.byte	2                               # Abbreviation Code
161	.byte	46                              # DW_TAG_subprogram
162	.byte	0                               # DW_CHILDREN_no
163	.byte	17                              # DW_AT_low_pc
164	.byte	27                              # DW_FORM_addrx
165	.byte	18                              # DW_AT_high_pc
166	.byte	6                               # DW_FORM_data4
167	.byte	64                              # DW_AT_frame_base
168	.byte	24                              # DW_FORM_exprloc
169	.byte	3                               # DW_AT_name
170	.byte	37                              # DW_FORM_strx1
171	.byte	58                              # DW_AT_decl_file
172	.byte	11                              # DW_FORM_data1
173	.byte	59                              # DW_AT_decl_line
174	.byte	11                              # DW_FORM_data1
175	.byte	73                              # DW_AT_type
176	.byte	19                              # DW_FORM_ref4
177	.byte	63                              # DW_AT_external
178	.byte	25                              # DW_FORM_flag_present
179	.byte	0                               # EOM(1)
180	.byte	0                               # EOM(2)
181	.byte	3                               # Abbreviation Code
182	.byte	36                              # DW_TAG_base_type
183	.byte	0                               # DW_CHILDREN_no
184	.byte	3                               # DW_AT_name
185	.byte	37                              # DW_FORM_strx1
186	.byte	62                              # DW_AT_encoding
187	.byte	11                              # DW_FORM_data1
188	.byte	11                              # DW_AT_byte_size
189	.byte	11                              # DW_FORM_data1
190	.byte	0                               # EOM(1)
191	.byte	0                               # EOM(2)
192	.byte	0                               # EOM(3)
193	.section	.debug_addr,"",@progbits
194	.long	.Ldebug_addr_end0-.Ldebug_addr_start0 # Length of contribution
195.Ldebug_addr_start0:
196	.short	5                               # DWARF version number
197	.byte	8                               # Address size
198	.byte	0                               # Segment selector size
199.Laddr_table_base0:
200	.quad	.Lfunc_begin0
201.Ldebug_addr_end0:
202	.section	.debug_gnu_pubnames,"",@progbits
203	.long	.LpubNames_end0-.LpubNames_begin0 # Length of Public Names Info
204.LpubNames_begin0:
205	.short	2                               # DWARF Version
206	.long	.Lcu_begin0                     # Offset of Compilation Unit Info
207	.long	40                              # Compilation Unit Length
208	.long	26                              # DIE offset
209	.byte	48                              # Attributes: FUNCTION, EXTERNAL
210	.asciz	"main"                          # External Name
211	.long	0                               # End Mark
212.LpubNames_end0:
213	.section	.debug_gnu_pubtypes,"",@progbits
214	.long	.LpubTypes_end0-.LpubTypes_begin0 # Length of Public Types Info
215.LpubTypes_begin0:
216	.short	2                               # DWARF Version
217	.long	.Lcu_begin0                     # Offset of Compilation Unit Info
218	.long	40                              # Compilation Unit Length
219	.long	41                              # DIE offset
220	.byte	144                             # Attributes: TYPE, STATIC
221	.asciz	"int"                           # External Name
222	.long	0                               # End Mark
223.LpubTypes_end0:
224	.ident	"clang version 12.0.0 (git@github.com:llvm/llvm-project.git 9a33f027ac7d73e14ae287e78ab554142d1cbc8f)"
225	.section	".note.GNU-stack","",@progbits
226	.addrsig
227	.section	.debug_line,"",@progbits
228.Lline_table_start0:
229	.section	.debug_loclists.dwo,"e",@progbits
230	.byte 	0
231