xref: /llvm-project/llvm/test/tools/llvm-dwarfdump/X86/debug-names-find.s (revision 54d736c416b19ed1ef4a88068d5bc3a3e66a4ee1)
1d99072bcSPavel Labath# RUN: llvm-mc -triple x86_64-pc-linux %s -filetype=obj -o %t
2*54d736c4SPavel Labath# RUN: llvm-dwarfdump -find=foo - <%t | FileCheck --check-prefix=FOO %s
3*54d736c4SPavel Labath# RUN: llvm-dwarfdump -find=baz - <%t | FileCheck --check-prefix=BAZ %s
4*54d736c4SPavel Labath# RUN: llvm-dwarfdump -find=missing - <%t | FileCheck --check-prefix=MISSING %s
5d99072bcSPavel Labath
6d99072bcSPavel Labath# FOO: DW_TAG_subprogram
7d99072bcSPavel Labath# FOO-NEXT: DW_AT_name ("foo")
8d99072bcSPavel Labath# FOO-NEXT: DW_AT_external
9d99072bcSPavel Labath
10d99072bcSPavel Labath# BAZ: DW_TAG_subprogram
11d99072bcSPavel Labath# BAZ-NEXT: DW_AT_name ("baz")
12d99072bcSPavel Labath# BAZ-NEXT: DW_AT_external
13d99072bcSPavel Labath
14d99072bcSPavel Labath# MISSING-NOT: foo
15d99072bcSPavel Labath# MISSING-NOT: bar
16d99072bcSPavel Labath# MISSING-NOT: baz
17d99072bcSPavel Labath# MISSING-NOT: bazz
18d99072bcSPavel Labath
19d99072bcSPavel Labath	.section	.debug_str,"MS",@progbits,1
20d99072bcSPavel Labath.Lstring_foo:
21d99072bcSPavel Labath	.asciz	"foo"
22d99072bcSPavel Labath.Lstring_foo_mangled:
23d99072bcSPavel Labath	.asciz	"_Z3foov"
24d99072bcSPavel Labath.Lstring_bar:
25d99072bcSPavel Labath	.asciz	"bar"
26d99072bcSPavel Labath.Lstring_baz:
27d99072bcSPavel Labath	.asciz	"baz"
28d99072bcSPavel Labath.Lstring_bazz:
29d99072bcSPavel Labath	.asciz	"bazz"
30d99072bcSPavel Labath.Lstring_producer:
31d99072bcSPavel Labath	.asciz	"Hand-written dwarf"
32d99072bcSPavel Labath
33d99072bcSPavel Labath	.section	.debug_abbrev,"",@progbits
34d99072bcSPavel Labath.Lsection_abbrev:
35d99072bcSPavel Labath	.byte	1                       # Abbreviation Code
36d99072bcSPavel Labath	.byte	17                      # DW_TAG_compile_unit
37d99072bcSPavel Labath	.byte	1                       # DW_CHILDREN_yes
38d99072bcSPavel Labath	.byte	37                      # DW_AT_producer
39d99072bcSPavel Labath	.byte	14                      # DW_FORM_strp
40d99072bcSPavel Labath	.byte	19                      # DW_AT_language
41d99072bcSPavel Labath	.byte	5                       # DW_FORM_data2
42d99072bcSPavel Labath	.byte	0                       # EOM(1)
43d99072bcSPavel Labath	.byte	0                       # EOM(2)
44d99072bcSPavel Labath	.byte	2                       # Abbreviation Code
45d99072bcSPavel Labath	.byte	46                      # DW_TAG_subprogram
46d99072bcSPavel Labath	.byte	0                       # DW_CHILDREN_no
47d99072bcSPavel Labath	.byte	3                       # DW_AT_name
48d99072bcSPavel Labath	.byte	14                      # DW_FORM_strp
49d99072bcSPavel Labath	.byte	63                      # DW_AT_external
50d99072bcSPavel Labath	.byte	25                      # DW_FORM_flag_present
51d99072bcSPavel Labath	.byte	0                       # EOM(1)
52d99072bcSPavel Labath	.byte	0                       # EOM(2)
53d99072bcSPavel Labath	.byte	0                       # EOM(3)
54d99072bcSPavel Labath
55d99072bcSPavel Labath	.section	.debug_info,"",@progbits
56d99072bcSPavel Labath.Lcu_begin0:
57d99072bcSPavel Labath	.long	.Lcu_end0-.Lcu_start0   # Length of Unit
58d99072bcSPavel Labath.Lcu_start0:
59d99072bcSPavel Labath	.short	4                       # DWARF version number
60d99072bcSPavel Labath	.long	.Lsection_abbrev        # Offset Into Abbrev. Section
61d99072bcSPavel Labath	.byte	8                       # Address Size (in bytes)
62d99072bcSPavel Labath	.byte	1                       # Abbrev [1] DW_TAG_compile_unit
63d99072bcSPavel Labath	.long	.Lstring_producer       # DW_AT_producer
64d99072bcSPavel Labath	.short	12                      # DW_AT_language
65d99072bcSPavel Labath.Ldie_foo:
66d99072bcSPavel Labath	.byte	2                       # Abbrev [2] DW_TAG_subprogram
67d99072bcSPavel Labath	.long	.Lstring_foo            # DW_AT_name
68d99072bcSPavel Labath                                        # DW_AT_external
69d99072bcSPavel Labath.Ldie_bar:
70d99072bcSPavel Labath	.byte	2                       # Abbrev [2] DW_TAG_subprogram
71d99072bcSPavel Labath	.long	.Lstring_bar            # DW_AT_name
72d99072bcSPavel Labath                                        # DW_AT_external
73d99072bcSPavel Labath	.byte	0                       # End Of Children Mark
74d99072bcSPavel Labath.Lcu_end0:
75d99072bcSPavel Labath
76d99072bcSPavel Labath.Lcu_begin1:
77d99072bcSPavel Labath	.long	.Lcu_end1-.Lcu_start1   # Length of Unit
78d99072bcSPavel Labath.Lcu_start1:
79d99072bcSPavel Labath	.short	4                       # DWARF version number
80d99072bcSPavel Labath	.long	.Lsection_abbrev        # Offset Into Abbrev. Section
81d99072bcSPavel Labath	.byte	8                       # Address Size (in bytes)
82d99072bcSPavel Labath	.byte	1                       # Abbrev [1] DW_TAG_compile_unit
83d99072bcSPavel Labath	.long	.Lstring_producer       # DW_AT_producer
84d99072bcSPavel Labath	.short	12                      # DW_AT_language
85d99072bcSPavel Labath.Ldie_baz:
86d99072bcSPavel Labath	.byte	2                       # Abbrev [2] DW_TAG_subprogram
87d99072bcSPavel Labath	.long	.Lstring_baz            # DW_AT_name
88d99072bcSPavel Labath                                        # DW_AT_external
89d99072bcSPavel Labath.Ldie_bazz:
90d99072bcSPavel Labath	.byte	2                       # Abbrev [2] DW_TAG_subprogram
91d99072bcSPavel Labath	.long	.Lstring_bazz           # DW_AT_name
92d99072bcSPavel Labath                                        # DW_AT_external
93d99072bcSPavel Labath	.byte	0                       # End Of Children Mark
94d99072bcSPavel Labath.Lcu_end1:
95d99072bcSPavel Labath
96d99072bcSPavel Labath	.section	.debug_names,"",@progbits
97d99072bcSPavel Labath	.long	.Lnames_end0-.Lnames_start0 # Header: contribution length
98d99072bcSPavel Labath.Lnames_start0:
99d99072bcSPavel Labath	.short	5                       # Header: version
100d99072bcSPavel Labath	.short	0                       # Header: padding
101d99072bcSPavel Labath	.long	1                       # Header: compilation unit count
102d99072bcSPavel Labath	.long	0                       # Header: local type unit count
103d99072bcSPavel Labath	.long	0                       # Header: foreign type unit count
104d99072bcSPavel Labath	.long	2                       # Header: bucket count
105d99072bcSPavel Labath	.long	3                       # Header: name count
106d99072bcSPavel Labath	.long	.Lnames_abbrev_end0-.Lnames_abbrev_start0 # Header: abbreviation table size
107d99072bcSPavel Labath	.long	0                       # Header: augmentation length
108d99072bcSPavel Labath	.long	.Lcu_begin0             # Compilation unit 0
109d99072bcSPavel Labath	.long	1                       # Bucket 0
110d99072bcSPavel Labath	.long	2                       # Bucket 1
111d99072bcSPavel Labath        .long   193487034               # Hash in Bucket 0
112d99072bcSPavel Labath	.long	193491849               # Hash in Bucket 1
113d99072bcSPavel Labath	.long	-1257882357             # Hash in Bucket 1
114d99072bcSPavel Labath	.long	.Lstring_bar            # String in Bucket 1: bar
115d99072bcSPavel Labath	.long	.Lstring_foo            # String in Bucket 1: foo
116d99072bcSPavel Labath	.long	.Lstring_foo_mangled    # String in Bucket 1: _Z3foov
117d99072bcSPavel Labath	.long	.Lnames0-.Lnames_entries0 # Offset in Bucket 1
118d99072bcSPavel Labath	.long	.Lnames1-.Lnames_entries0 # Offset in Bucket 1
119d99072bcSPavel Labath	.long	.Lnames2-.Lnames_entries0 # Offset in Bucket 1
120d99072bcSPavel Labath.Lnames_abbrev_start0:
121d99072bcSPavel Labath	.byte	46                      # Abbrev code
122d99072bcSPavel Labath	.byte	46                      # DW_TAG_subprogram
123d99072bcSPavel Labath	.byte	3                       # DW_IDX_die_offset
1242d1fc437SPavel Labath	.byte	19                      # DW_FORM_ref4
125d99072bcSPavel Labath	.byte	0                       # End of abbrev
126d99072bcSPavel Labath	.byte	0                       # End of abbrev
127d99072bcSPavel Labath	.byte	0                       # End of abbrev list
128d99072bcSPavel Labath.Lnames_abbrev_end0:
129d99072bcSPavel Labath.Lnames_entries0:
130d99072bcSPavel Labath.Lnames0:
131d99072bcSPavel Labath	.byte	46                      # Abbrev code
13247c3472cSPavel Labath	.long	.Ldie_bar-.Lcu_begin0   # DW_IDX_die_offset
133d99072bcSPavel Labath	.long	0                       # End of list: bar
134d99072bcSPavel Labath.Lnames1:
135d99072bcSPavel Labath	.byte	46                      # Abbrev code
13647c3472cSPavel Labath	.long	.Ldie_foo-.Lcu_begin0   # DW_IDX_die_offset
137d99072bcSPavel Labath	.long	0                       # End of list: foo
138d99072bcSPavel Labath.Lnames2:
139d99072bcSPavel Labath	.byte	46                      # Abbrev code
14047c3472cSPavel Labath	.long	.Ldie_foo-.Lcu_begin0   # DW_IDX_die_offset
141d99072bcSPavel Labath	.long	0                       # End of list: _Z3foov
142d99072bcSPavel Labath	.p2align	2
143d99072bcSPavel Labath.Lnames_end0:
144d99072bcSPavel Labath
145d99072bcSPavel Labath# Index of compilation unit 1. This one has no hash table.
146d99072bcSPavel Labath	.long	.Lnames_end1-.Lnames_start1 # Header: contribution length
147d99072bcSPavel Labath.Lnames_start1:
148d99072bcSPavel Labath	.short	5                       # Header: version
149d99072bcSPavel Labath	.short	0                       # Header: padding
150d99072bcSPavel Labath	.long	1                       # Header: compilation unit count
151d99072bcSPavel Labath	.long	0                       # Header: local type unit count
152d99072bcSPavel Labath	.long	0                       # Header: foreign type unit count
153d99072bcSPavel Labath	.long	0                       # Header: bucket count
154d99072bcSPavel Labath	.long	2                       # Header: name count
155d99072bcSPavel Labath	.long	.Lnames_abbrev_end1-.Lnames_abbrev_start1 # Header: abbreviation table size
156d99072bcSPavel Labath	.long	0                       # Header: augmentation length
157d99072bcSPavel Labath	.long	.Lcu_begin1             # Compilation unit 0
158d99072bcSPavel Labath	.long	.Lstring_baz            # String in Bucket 1: baz
159d99072bcSPavel Labath	.long	.Lstring_bazz           # String in Bucket 1: bazz
160d99072bcSPavel Labath	.long	.Lnames3-.Lnames_entries1 # Offset in Bucket 1
161d99072bcSPavel Labath	.long	.Lnames4-.Lnames_entries1 # Offset in Bucket 1
162d99072bcSPavel Labath.Lnames_abbrev_start1:
163d99072bcSPavel Labath	.byte	46                      # Abbrev code
164d99072bcSPavel Labath	.byte	46                      # DW_TAG_subprogram
165d99072bcSPavel Labath	.byte	3                       # DW_IDX_die_offset
1662d1fc437SPavel Labath	.byte	19                      # DW_FORM_ref4
167d99072bcSPavel Labath	.byte	0                       # End of abbrev
168d99072bcSPavel Labath	.byte	0                       # End of abbrev
169d99072bcSPavel Labath	.byte	0                       # End of abbrev list
170d99072bcSPavel Labath.Lnames_abbrev_end1:
171d99072bcSPavel Labath.Lnames_entries1:
172d99072bcSPavel Labath.Lnames3:
173d99072bcSPavel Labath	.byte	46                      # Abbrev code
17447c3472cSPavel Labath	.long	.Ldie_baz-.Lcu_begin1   # DW_IDX_die_offset
175d99072bcSPavel Labath	.long	0                       # End of list: baz
176d99072bcSPavel Labath	.p2align	2
177d99072bcSPavel Labath.Lnames4:
178d99072bcSPavel Labath	.byte	46                      # Abbrev code
17947c3472cSPavel Labath	.long	.Ldie_bazz-.Lcu_begin1  # DW_IDX_die_offset
180d99072bcSPavel Labath	.long	0                       # End of list: baz
181d99072bcSPavel Labath	.p2align	2
182d99072bcSPavel Labath.Lnames_end1:
183