1 # RUN: llvm-mc -triple x86_64-pc-linux %s -filetype=obj -o %t
2 # RUN: llvm-dwarfdump -find=foo - <%t | FileCheck --check-prefix=FOO %s
3 # RUN: llvm-dwarfdump -find=baz - <%t | FileCheck --check-prefix=BAZ %s
4 # RUN: llvm-dwarfdump -find=missing - <%t | FileCheck --check-prefix=MISSING %s
6 # FOO: DW_TAG_subprogram
7 # FOO-NEXT: DW_AT_name ("foo")
8 # FOO-NEXT: DW_AT_external
10 # BAZ: DW_TAG_subprogram
11 # BAZ-NEXT: DW_AT_name ("baz")
12 # BAZ-NEXT: DW_AT_external
19 .section .debug_str,"MS",@progbits,1
31 .asciz "Hand-written dwarf"
33 .section .debug_abbrev,"",@progbits
35 .byte 1 # Abbreviation Code
36 .byte 17 # DW_TAG_compile_unit
37 .byte 1 # DW_CHILDREN_yes
38 .byte 37 # DW_AT_producer
39 .byte 14 # DW_FORM_strp
40 .byte 19 # DW_AT_language
41 .byte 5 # DW_FORM_data2
44 .byte 2 # Abbreviation Code
45 .byte 46 # DW_TAG_subprogram
46 .byte 0 # DW_CHILDREN_no
48 .byte 14 # DW_FORM_strp
49 .byte 63 # DW_AT_external
50 .byte 25 # DW_FORM_flag_present
55 .section .debug_info,"",@progbits
57 .long .Lcu_end0-.Lcu_start0 # Length of Unit
59 .short 4 # DWARF version number
60 .long .Lsection_abbrev # Offset Into Abbrev. Section
61 .byte 8 # Address Size (in bytes)
62 .byte 1 # Abbrev [1] DW_TAG_compile_unit
63 .long .Lstring_producer # DW_AT_producer
64 .short 12 # DW_AT_language
66 .byte 2 # Abbrev [2] DW_TAG_subprogram
67 .long .Lstring_foo # DW_AT_name
70 .byte 2 # Abbrev [2] DW_TAG_subprogram
71 .long .Lstring_bar # DW_AT_name
73 .byte 0 # End Of Children Mark
77 .long .Lcu_end1-.Lcu_start1 # Length of Unit
79 .short 4 # DWARF version number
80 .long .Lsection_abbrev # Offset Into Abbrev. Section
81 .byte 8 # Address Size (in bytes)
82 .byte 1 # Abbrev [1] DW_TAG_compile_unit
83 .long .Lstring_producer # DW_AT_producer
84 .short 12 # DW_AT_language
86 .byte 2 # Abbrev [2] DW_TAG_subprogram
87 .long .Lstring_baz # DW_AT_name
90 .byte 2 # Abbrev [2] DW_TAG_subprogram
91 .long .Lstring_bazz # DW_AT_name
93 .byte 0 # End Of Children Mark
96 .section .debug_names,"",@progbits
97 .long .Lnames_end0-.Lnames_start0 # Header: contribution length
99 .short 5 # Header: version
100 .short 0 # Header: padding
101 .long 1 # Header: compilation unit count
102 .long 0 # Header: local type unit count
103 .long 0 # Header: foreign type unit count
104 .long 2 # Header: bucket count
105 .long 3 # Header: name count
106 .long .Lnames_abbrev_end0-.Lnames_abbrev_start0 # Header: abbreviation table size
107 .long 0 # Header: augmentation length
108 .long .Lcu_begin0 # Compilation unit 0
111 .long 193487034 # Hash in Bucket 0
112 .long 193491849 # Hash in Bucket 1
113 .long -1257882357 # Hash in Bucket 1
114 .long .Lstring_bar # String in Bucket 1: bar
115 .long .Lstring_foo # String in Bucket 1: foo
116 .long .Lstring_foo_mangled # String in Bucket 1: _Z3foov
117 .long .Lnames0-.Lnames_entries0 # Offset in Bucket 1
118 .long .Lnames1-.Lnames_entries0 # Offset in Bucket 1
119 .long .Lnames2-.Lnames_entries0 # Offset in Bucket 1
120 .Lnames_abbrev_start0:
121 .byte 46 # Abbrev code
122 .byte 46 # DW_TAG_subprogram
123 .byte 3 # DW_IDX_die_offset
124 .byte 19 # DW_FORM_ref4
125 .byte 0 # End of abbrev
126 .byte 0 # End of abbrev
127 .byte 0 # End of abbrev list
131 .byte 46 # Abbrev code
132 .long .Ldie_bar-.Lcu_begin0 # DW_IDX_die_offset
133 .long 0 # End of list: bar
135 .byte 46 # Abbrev code
136 .long .Ldie_foo-.Lcu_begin0 # DW_IDX_die_offset
137 .long 0 # End of list: foo
139 .byte 46 # Abbrev code
140 .long .Ldie_foo-.Lcu_begin0 # DW_IDX_die_offset
141 .long 0 # End of list: _Z3foov
145 # Index of compilation unit 1. This one has no hash table.
146 .long .Lnames_end1-.Lnames_start1 # Header: contribution length
148 .short 5 # Header: version
149 .short 0 # Header: padding
150 .long 1 # Header: compilation unit count
151 .long 0 # Header: local type unit count
152 .long 0 # Header: foreign type unit count
153 .long 0 # Header: bucket count
154 .long 2 # Header: name count
155 .long .Lnames_abbrev_end1-.Lnames_abbrev_start1 # Header: abbreviation table size
156 .long 0 # Header: augmentation length
157 .long .Lcu_begin1 # Compilation unit 0
158 .long .Lstring_baz # String in Bucket 1: baz
159 .long .Lstring_bazz # String in Bucket 1: bazz
160 .long .Lnames3-.Lnames_entries1 # Offset in Bucket 1
161 .long .Lnames4-.Lnames_entries1 # Offset in Bucket 1
162 .Lnames_abbrev_start1:
163 .byte 46 # Abbrev code
164 .byte 46 # DW_TAG_subprogram
165 .byte 3 # DW_IDX_die_offset
166 .byte 19 # DW_FORM_ref4
167 .byte 0 # End of abbrev
168 .byte 0 # End of abbrev
169 .byte 0 # End of abbrev list
173 .byte 46 # Abbrev code
174 .long .Ldie_baz-.Lcu_begin1 # DW_IDX_die_offset
175 .long 0 # End of list: baz
178 .byte 46 # Abbrev code
179 .long .Ldie_bazz-.Lcu_begin1 # DW_IDX_die_offset
180 .long 0 # End of list: baz