1 # RUN: llvm-mc -triple x86_64-pc-linux %s -filetype=obj -o - | llvm-dwarfdump -debug-names - | FileCheck %s
2 .section .debug_str,"MS",@progbits,1
10 # Fake .debug_info. We just need it for the offsets to two "compile units" and
12 .section .debug_info,"",@progbits
22 .section .debug_names,"",@progbits
23 .long .Lnames_end0-.Lnames_start0 # Header: contribution length
25 .short 5 # Header: version
26 .short 0 # Header: padding
27 .long 1 # Header: compilation unit count
28 .long 0 # Header: local type unit count
29 .long 0 # Header: foreign type unit count
30 .long 2 # Header: bucket count
31 .long 2 # Header: name count
32 .long .Lnames_abbrev_end0-.Lnames_abbrev_start0 # Header: abbreviation table size
33 .long 0 # Header: augmentation length
34 .long .Lcu_begin0 # Compilation unit 0
37 .long 193491849 # Hash in Bucket 1
38 .long -1257882357 # Hash in Bucket 1
39 .long .Linfo_string0 # String in Bucket 1: foo
40 .long .Linfo_string1 # String in Bucket 1: _Z3foov
41 .long .Lnames0-.Lnames_entries0 # Offset in Bucket 1
42 .long .Lnames1-.Lnames_entries0 # Offset in Bucket 1
43 .Lnames_abbrev_start0:
44 .byte 46 # Abbrev code
45 .byte 46 # DW_TAG_subprogram
46 .byte 3 # DW_IDX_die_offset
47 .byte 19 # DW_FORM_ref4
48 .byte 0 # End of abbrev
49 .byte 0 # End of abbrev
50 .byte 0 # End of abbrev list
54 .byte 46 # Abbrev code
55 .long .Ldie0-.Lcu_begin0 # DW_IDX_die_offset
56 .long 0 # End of list: foo
58 .byte 46 # Abbrev code
59 .long .Ldie0-.Lcu_begin0 # DW_IDX_die_offset
60 .long 0 # End of list: _Z3foov
64 .long .Lnames_end1-.Lnames_start1 # Header: contribution length
66 .short 5 # Header: version
67 .short 0 # Header: padding
68 .long 1 # Header: compilation unit count
69 .long 0 # Header: local type unit count
70 .long 0 # Header: foreign type unit count
71 .long 1 # Header: bucket count
72 .long 1 # Header: name count
73 .long .Lnames_abbrev_end1-.Lnames_abbrev_start1 # Header: abbreviation table size
74 .long 0 # Header: augmentation length
75 .long .Lcu_begin1 # Compilation unit 0
77 .long 193487034 # Hash in Bucket 0
78 .long .Linfo_string2 # String in Bucket 0: bar
79 .long .Lnames2-.Lnames_entries1 # Offset in Bucket 0
80 .Lnames_abbrev_start1:
81 .byte 52 # Abbrev code
82 .byte 52 # DW_TAG_variable
83 .byte 3 # DW_IDX_die_offset
84 .byte 19 # DW_FORM_ref4
85 .byte 0 # End of abbrev
86 .byte 0 # End of abbrev
87 .byte 0 # End of abbrev list
91 .byte 52 # Abbrev code
92 .long .Ldie1-.Lcu_begin1 # DW_IDX_die_offset
93 .long 0 # End of list: bar
97 .long 0xffffffff # DWARF64 mark
98 .quad .Lnames_end2-.Lnames_start2 # Length
103 .long 1 # Local TU count
104 .long 1 # Foreign TU count
105 .long 1 # Bucket count
107 .long .Lnames_abbrev_end2-.Lnames_abbrev_start2 # Abbreviations table size
108 .long 0 # Augmentation string size
109 .quad 0xcc00cccccccc # CU0 offset
110 .quad 0xaa00aaaaaaaa # Local TU0 offset
111 .quad 0xffffff00ffffffff # Foreign TU2 signature
113 .long 0xb887389 # Hash in Bucket 0
114 .quad .Linfo_string0 # String in Bucket 0: foo
115 .quad .Lnames3-.Lnames_entries2 # Offset in Bucket 0
116 .Lnames_abbrev_start2:
117 .byte 0x01 # Abbrev code
118 .byte 0x24 # DW_TAG_base_type
119 .byte 0x02 # DW_IDX_type_unit
120 .byte 0x06 # DW_FORM_data4
121 .byte 0x05 # DW_IDX_type_hash
122 .byte 0x07 # DW_FORM_data8
123 .byte 0x00 # End of abbrev
124 .byte 0x00 # End of abbrev
125 .byte 0x00 # End of abbrev list
129 .byte 0x01 # Abbrev code
130 .long 1 # DW_IDX_type_unit
131 .quad 0xff03ffffffff # DW_IDX_type_hash
132 .byte 0x00 # End of list: foo
136 # CHECK: .debug_names contents:
137 # CHECK-NEXT: Name Index @ 0x0 {
138 # CHECK-NEXT: Header {
139 # CHECK-NEXT: Length: 0x60
140 # CHECK-NEXT: Format: DWARF32
141 # CHECK-NEXT: Version: 5
142 # CHECK-NEXT: CU count: 1
143 # CHECK-NEXT: Local TU count: 0
144 # CHECK-NEXT: Foreign TU count: 0
145 # CHECK-NEXT: Bucket count: 2
146 # CHECK-NEXT: Name count: 2
147 # CHECK-NEXT: Abbreviations table size: 0x7
148 # CHECK-NEXT: Augmentation: ''
150 # CHECK-NEXT: Compilation Unit offsets [
151 # CHECK-NEXT: CU[0]: 0x00000000
153 # CHECK-NEXT: Abbreviations [
154 # CHECK-NEXT: Abbreviation 0x2e {
155 # CHECK-NEXT: Tag: DW_TAG_subprogram
156 # CHECK-NEXT: DW_IDX_die_offset: DW_FORM_ref4
159 # CHECK-NEXT: Bucket 0 [
162 # CHECK-NEXT: Bucket 1 [
163 # CHECK-NEXT: Name 1 {
164 # CHECK-NEXT: Hash: 0xB887389
165 # CHECK-NEXT: String: 0x00000000 "foo"
166 # CHECK-NEXT: Entry @ 0x4f {
167 # CHECK-NEXT: Abbrev: 0x2E
168 # CHECK-NEXT: Tag: DW_TAG_subprogram
169 # CHECK-NEXT: DW_IDX_die_offset: 0x00000001
172 # CHECK-NEXT: Name 2 {
173 # CHECK-NEXT: Hash: 0xB5063D0B
174 # CHECK-NEXT: String: 0x00000004 "_Z3foov"
175 # CHECK-NEXT: Entry @ 0x58 {
176 # CHECK-NEXT: Abbrev: 0x2E
177 # CHECK-NEXT: Tag: DW_TAG_subprogram
178 # CHECK-NEXT: DW_IDX_die_offset: 0x00000001
183 # CHECK-NEXT: Name Index @ 0x64 {
184 # CHECK-NEXT: Header {
185 # CHECK-NEXT: Length: 0x44
186 # CHECK-NEXT: Format: DWARF32
187 # CHECK-NEXT: Version: 5
188 # CHECK-NEXT: CU count: 1
189 # CHECK-NEXT: Local TU count: 0
190 # CHECK-NEXT: Foreign TU count: 0
191 # CHECK-NEXT: Bucket count: 1
192 # CHECK-NEXT: Name count: 1
193 # CHECK-NEXT: Abbreviations table size: 0x7
194 # CHECK-NEXT: Augmentation: ''
196 # CHECK-NEXT: Compilation Unit offsets [
197 # CHECK-NEXT: CU[0]: 0x00000002
199 # CHECK-NEXT: Abbreviations [
200 # CHECK-NEXT: Abbreviation 0x34 {
201 # CHECK-NEXT: Tag: DW_TAG_variable
202 # CHECK-NEXT: DW_IDX_die_offset: DW_FORM_ref4
205 # CHECK-NEXT: Bucket 0 [
206 # CHECK-NEXT: Name 1 {
207 # CHECK-NEXT: Hash: 0xB8860BA
208 # CHECK-NEXT: String: 0x0000000c "bar"
209 # CHECK-NEXT: Entry @ 0xa3 {
210 # CHECK-NEXT: Abbrev: 0x34
211 # CHECK-NEXT: Tag: DW_TAG_variable
212 # CHECK-NEXT: DW_IDX_die_offset: 0x00000001
217 # CHECK-NEXT: Name Index @ 0xac {
218 # CHECK-NEXT: Header {
219 # CHECK-NEXT: Length: 0x68
220 # CHECK-NEXT: Format: DWARF64
221 # CHECK-NEXT: Version: 5
222 # CHECK-NEXT: CU count: 1
223 # CHECK-NEXT: Local TU count: 1
224 # CHECK-NEXT: Foreign TU count: 1
225 # CHECK-NEXT: Bucket count: 1
226 # CHECK-NEXT: Name count: 1
227 # CHECK-NEXT: Abbreviations table size: 0x9
228 # CHECK-NEXT: Augmentation: ''
230 # CHECK-NEXT: Compilation Unit offsets [
231 # CHECK-NEXT: CU[0]: 0xcc00cccccccc
233 # CHECK-NEXT: Local Type Unit offsets [
234 # CHECK-NEXT: LocalTU[0]: 0xaa00aaaaaaaa
236 # CHECK-NEXT: Foreign Type Unit signatures [
237 # CHECK-NEXT: ForeignTU[0]: 0xffffff00ffffffff
239 # CHECK-NEXT: Abbreviations [
240 # CHECK-NEXT: Abbreviation 0x1 {
241 # CHECK-NEXT: Tag: DW_TAG_base_type
242 # CHECK-NEXT: DW_IDX_type_unit: DW_FORM_data4
243 # CHECK-NEXT: DW_IDX_type_hash: DW_FORM_data8
246 # CHECK-NEXT: Bucket 0 [
247 # CHECK-NEXT: Name 1 {
248 # CHECK-NEXT: Hash: 0xB887389
249 # CHECK-NEXT: String: 0x00000000 "foo"
250 # CHECK-NEXT: Entry @ 0x111 {
251 # CHECK-NEXT: Abbrev: 0x1
252 # CHECK-NEXT: Tag: DW_TAG_base_type
253 # CHECK-NEXT: DW_IDX_type_unit: 0x00000001
254 # CHECK-NEXT: DW_IDX_type_hash: 0x0000ff03ffffffff