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
96 # CHECK: .debug_names contents:
97 # CHECK-NEXT: Name Index @ 0x0 {
98 # CHECK-NEXT: Header {
99 # CHECK-NEXT: Length: 0x60
100 # CHECK-NEXT: Version: 5
101 # CHECK-NEXT: Padding: 0x0
102 # CHECK-NEXT: CU count: 1
103 # CHECK-NEXT: Local TU count: 0
104 # CHECK-NEXT: Foreign TU count: 0
105 # CHECK-NEXT: Bucket count: 2
106 # CHECK-NEXT: Name count: 2
107 # CHECK-NEXT: Abbreviations table size: 0x7
108 # CHECK-NEXT: Augmentation: ''
110 # CHECK-NEXT: Compilation Unit offsets [
111 # CHECK-NEXT: CU[0]: 0x00000000
113 # CHECK-NEXT: Abbreviations [
114 # CHECK-NEXT: Abbreviation 0x2e {
115 # CHECK-NEXT: Tag: DW_TAG_subprogram
116 # CHECK-NEXT: DW_IDX_die_offset: DW_FORM_ref4
119 # CHECK-NEXT: Bucket 0 [
122 # CHECK-NEXT: Bucket 1 [
123 # CHECK-NEXT: Name 1 {
124 # CHECK-NEXT: Hash: 0xB887389
125 # CHECK-NEXT: String: 0x00000000 "foo"
126 # CHECK-NEXT: Entry @ 0x4f {
127 # CHECK-NEXT: Abbrev: 0x2E
128 # CHECK-NEXT: Tag: DW_TAG_subprogram
129 # CHECK-NEXT: DW_IDX_die_offset: 0x00000001
132 # CHECK-NEXT: Name 2 {
133 # CHECK-NEXT: Hash: 0xB5063D0B
134 # CHECK-NEXT: String: 0x00000004 "_Z3foov"
135 # CHECK-NEXT: Entry @ 0x58 {
136 # CHECK-NEXT: Abbrev: 0x2E
137 # CHECK-NEXT: Tag: DW_TAG_subprogram
138 # CHECK-NEXT: DW_IDX_die_offset: 0x00000001
143 # CHECK-NEXT: Name Index @ 0x64 {
144 # CHECK-NEXT: Header {
145 # CHECK-NEXT: Length: 0x44
146 # CHECK-NEXT: Version: 5
147 # CHECK-NEXT: Padding: 0x0
148 # CHECK-NEXT: CU count: 1
149 # CHECK-NEXT: Local TU count: 0
150 # CHECK-NEXT: Foreign TU count: 0
151 # CHECK-NEXT: Bucket count: 1
152 # CHECK-NEXT: Name count: 1
153 # CHECK-NEXT: Abbreviations table size: 0x7
154 # CHECK-NEXT: Augmentation: ''
156 # CHECK-NEXT: Compilation Unit offsets [
157 # CHECK-NEXT: CU[0]: 0x00000002
159 # CHECK-NEXT: Abbreviations [
160 # CHECK-NEXT: Abbreviation 0x34 {
161 # CHECK-NEXT: Tag: DW_TAG_variable
162 # CHECK-NEXT: DW_IDX_die_offset: DW_FORM_ref4
165 # CHECK-NEXT: Bucket 0 [
166 # CHECK-NEXT: Name 1 {
167 # CHECK-NEXT: Hash: 0xB8860BA
168 # CHECK-NEXT: String: 0x0000000c "bar"
169 # CHECK-NEXT: Entry @ 0xa3 {
170 # CHECK-NEXT: Abbrev: 0x34
171 # CHECK-NEXT: Tag: DW_TAG_variable
172 # CHECK-NEXT: DW_IDX_die_offset: 0x00000001