1 # RUN: llvm-mc -triple x86_64-apple-darwin %s -filetype=obj -o %t
2 # RUN: llvm-dwarfdump --debug-info=0x0000002a -p %t | FileCheck %s --check-prefix=PARENTS
3 # RUN: llvm-dwarfdump --debug-info=0x0000002a -c %t | FileCheck %s --check-prefix=CHILDREN
4 # RUN: llvm-dwarfdump --debug-info=0x0000002a -p -c %t | FileCheck %s --check-prefix=BOTH
6 # PARENTS: DW_TAG_compile_unit
7 # PARENTS: DW_TAG_enumeration_type
8 # PARENTS-NOT: DW_TAG_enumerator
10 # CHILDREN-NOT: DW_TAG_compile_unit
11 # CHILDREN: DW_TAG_enumerator
12 # CHILDREN: DW_AT_name ("first")
13 # CHILDREN: DW_TAG_enumerator
14 # CHILDREN: DW_AT_name ("second")
16 # BOTH: DW_TAG_compile_unit
17 # BOTH: DW_TAG_enumeration_type
18 # BOTH: DW_TAG_enumerator
19 # BOTH: DW_AT_name ("first")
20 # BOTH: DW_TAG_enumerator
21 # BOTH: DW_AT_name ("second")
23 # BOTH-NOT: DW_TAG_compile_unit
24 # BOTH-NOT: DW_TAG_enumeration_type
25 # BOTH-NOT: DW_TAG_enumerator
27 .section __TEXT,__text,regular,pure_instructions
28 .file 1 "/private/tmp" "/tmp/enum.c"
29 .globl _main ## -- Begin function main
33 .loc 1 4 0 ## /tmp/enum.c:4:0
37 .cfi_def_cfa_offset 16
40 .cfi_def_cfa_register %rbp
43 .loc 1 5 7 prologue_end ## /tmp/enum.c:5:7
45 .loc 1 6 10 ## /tmp/enum.c:6:10
47 .loc 1 6 3 is_stmt 0 ## /tmp/enum.c:6:3
54 .section __DWARF,__debug_str,regular,debug
56 .asciz "clang version 7.0.0 " ## string offset=0
57 .asciz "/tmp/enum.c" ## string offset=21
58 .asciz "/private/tmp" ## string offset=33
59 .asciz "unsigned int" ## string offset=46
60 .asciz "first" ## string offset=59
61 .asciz "second" ## string offset=65
62 .asciz "main" ## string offset=72
63 .asciz "int" ## string offset=77
64 .asciz "var" ## string offset=81
65 .section __DWARF,__debug_abbrev,regular,debug
67 .byte 1 ## Abbreviation Code
68 .byte 17 ## DW_TAG_compile_unit
69 .byte 1 ## DW_CHILDREN_yes
70 .byte 37 ## DW_AT_producer
71 .byte 14 ## DW_FORM_strp
72 .byte 19 ## DW_AT_language
73 .byte 5 ## DW_FORM_data2
75 .byte 14 ## DW_FORM_strp
76 .byte 16 ## DW_AT_stmt_list
77 .byte 23 ## DW_FORM_sec_offset
78 .byte 27 ## DW_AT_comp_dir
79 .byte 14 ## DW_FORM_strp
80 .byte 17 ## DW_AT_low_pc
81 .byte 1 ## DW_FORM_addr
82 .byte 18 ## DW_AT_high_pc
83 .byte 6 ## DW_FORM_data4
86 .byte 2 ## Abbreviation Code
87 .byte 4 ## DW_TAG_enumeration_type
88 .byte 1 ## DW_CHILDREN_yes
89 .byte 73 ## DW_AT_type
90 .byte 19 ## DW_FORM_ref4
91 .byte 11 ## DW_AT_byte_size
92 .byte 11 ## DW_FORM_data1
93 .byte 58 ## DW_AT_decl_file
94 .byte 11 ## DW_FORM_data1
95 .byte 59 ## DW_AT_decl_line
96 .byte 11 ## DW_FORM_data1
99 .byte 3 ## Abbreviation Code
100 .byte 40 ## DW_TAG_enumerator
101 .byte 0 ## DW_CHILDREN_no
102 .byte 3 ## DW_AT_name
103 .byte 14 ## DW_FORM_strp
104 .byte 28 ## DW_AT_const_value
105 .byte 15 ## DW_FORM_udata
108 .byte 4 ## Abbreviation Code
109 .byte 36 ## DW_TAG_base_type
110 .byte 0 ## DW_CHILDREN_no
111 .byte 3 ## DW_AT_name
112 .byte 14 ## DW_FORM_strp
113 .byte 62 ## DW_AT_encoding
114 .byte 11 ## DW_FORM_data1
115 .byte 11 ## DW_AT_byte_size
116 .byte 11 ## DW_FORM_data1
119 .byte 5 ## Abbreviation Code
120 .byte 46 ## DW_TAG_subprogram
121 .byte 1 ## DW_CHILDREN_yes
122 .byte 17 ## DW_AT_low_pc
123 .byte 1 ## DW_FORM_addr
124 .byte 18 ## DW_AT_high_pc
125 .byte 6 ## DW_FORM_data4
126 .byte 64 ## DW_AT_frame_base
127 .byte 24 ## DW_FORM_exprloc
128 .byte 3 ## DW_AT_name
129 .byte 14 ## DW_FORM_strp
130 .byte 58 ## DW_AT_decl_file
131 .byte 11 ## DW_FORM_data1
132 .byte 59 ## DW_AT_decl_line
133 .byte 11 ## DW_FORM_data1
134 .byte 73 ## DW_AT_type
135 .byte 19 ## DW_FORM_ref4
136 .byte 63 ## DW_AT_external
137 .byte 25 ## DW_FORM_flag_present
140 .byte 6 ## Abbreviation Code
141 .byte 52 ## DW_TAG_variable
142 .byte 0 ## DW_CHILDREN_no
143 .byte 2 ## DW_AT_location
144 .byte 24 ## DW_FORM_exprloc
145 .byte 3 ## DW_AT_name
146 .byte 14 ## DW_FORM_strp
147 .byte 58 ## DW_AT_decl_file
148 .byte 11 ## DW_FORM_data1
149 .byte 59 ## DW_AT_decl_line
150 .byte 11 ## DW_FORM_data1
151 .byte 73 ## DW_AT_type
152 .byte 19 ## DW_FORM_ref4
156 .section __DWARF,__debug_info,regular,debug
159 .long 114 ## Length of Unit
160 .short 4 ## DWARF version number
161 .set Lset0, Lsection_abbrev-Lsection_abbrev ## Offset Into Abbrev. Section
163 .byte 8 ## Address Size (in bytes)
164 .byte 1 ## Abbrev [1] 0xb:0x6b DW_TAG_compile_unit
165 .long 0 ## DW_AT_producer
166 .short 12 ## DW_AT_language
167 .long 21 ## DW_AT_name
168 .set Lset1, Lline_table_start0-Lsection_line ## DW_AT_stmt_list
170 .long 33 ## DW_AT_comp_dir
171 .quad Lfunc_begin0 ## DW_AT_low_pc
172 .set Lset2, Lfunc_end0-Lfunc_begin0 ## DW_AT_high_pc
174 .byte 2 ## Abbrev [2] 0x2a:0x15 DW_TAG_enumeration_type
175 .long 63 ## DW_AT_type
176 .byte 4 ## DW_AT_byte_size
177 .byte 1 ## DW_AT_decl_file
178 .byte 1 ## DW_AT_decl_line
179 .byte 3 ## Abbrev [3] 0x32:0x6 DW_TAG_enumerator
180 .long 59 ## DW_AT_name
181 .byte 0 ## DW_AT_const_value
182 .byte 3 ## Abbrev [3] 0x38:0x6 DW_TAG_enumerator
183 .long 65 ## DW_AT_name
184 .byte 1 ## DW_AT_const_value
185 .byte 0 ## End Of Children Mark
186 .byte 4 ## Abbrev [4] 0x3f:0x7 DW_TAG_base_type
187 .long 46 ## DW_AT_name
188 .byte 7 ## DW_AT_encoding
189 .byte 4 ## DW_AT_byte_size
190 .byte 5 ## Abbrev [5] 0x46:0x28 DW_TAG_subprogram
191 .quad Lfunc_begin0 ## DW_AT_low_pc
192 .set Lset3, Lfunc_end0-Lfunc_begin0 ## DW_AT_high_pc
194 .byte 1 ## DW_AT_frame_base
196 .long 72 ## DW_AT_name
197 .byte 1 ## DW_AT_decl_file
198 .byte 3 ## DW_AT_decl_line
199 .long 110 ## DW_AT_type
201 .byte 6 ## Abbrev [6] 0x5f:0xe DW_TAG_variable
202 .byte 2 ## DW_AT_location
205 .long 81 ## DW_AT_name
206 .byte 1 ## DW_AT_decl_file
207 .byte 5 ## DW_AT_decl_line
208 .long 110 ## DW_AT_type
209 .byte 0 ## End Of Children Mark
210 .byte 4 ## Abbrev [4] 0x6e:0x7 DW_TAG_base_type
211 .long 77 ## DW_AT_name
212 .byte 5 ## DW_AT_encoding
213 .byte 4 ## DW_AT_byte_size
214 .byte 0 ## End Of Children Mark
215 .section __DWARF,__debug_ranges,regular,debug
217 .section __DWARF,__debug_macinfo,regular,debug
219 .byte 0 ## End Of Macro List Mark
220 .section __DWARF,__apple_names,regular,debug
222 .long 1212240712 ## Header Magic
223 .short 1 ## Header Version
224 .short 0 ## Header Hash Function
225 .long 1 ## Header Bucket Count
226 .long 1 ## Header Hash Count
227 .long 12 ## Header Data Length
228 .long 0 ## HeaderData Die Offset Base
229 .long 1 ## HeaderData Atom Count
230 .short 1 ## DW_ATOM_die_offset
231 .short 6 ## DW_FORM_data4
233 .long 2090499946 ## Hash in Bucket 0
234 .set Lset4, LNames0-Lnames_begin ## Offset in Bucket 0
241 .section __DWARF,__apple_objc,regular,debug
243 .long 1212240712 ## Header Magic
244 .short 1 ## Header Version
245 .short 0 ## Header Hash Function
246 .long 1 ## Header Bucket Count
247 .long 0 ## Header Hash Count
248 .long 12 ## Header Data Length
249 .long 0 ## HeaderData Die Offset Base
250 .long 1 ## HeaderData Atom Count
251 .short 1 ## DW_ATOM_die_offset
252 .short 6 ## DW_FORM_data4
254 .section __DWARF,__apple_namespac,regular,debug
256 .long 1212240712 ## Header Magic
257 .short 1 ## Header Version
258 .short 0 ## Header Hash Function
259 .long 1 ## Header Bucket Count
260 .long 0 ## Header Hash Count
261 .long 12 ## Header Data Length
262 .long 0 ## HeaderData Die Offset Base
263 .long 1 ## HeaderData Atom Count
264 .short 1 ## DW_ATOM_die_offset
265 .short 6 ## DW_FORM_data4
267 .section __DWARF,__apple_types,regular,debug
269 .long 1212240712 ## Header Magic
270 .short 1 ## Header Version
271 .short 0 ## Header Hash Function
272 .long 2 ## Header Bucket Count
273 .long 2 ## Header Hash Count
274 .long 20 ## Header Data Length
275 .long 0 ## HeaderData Die Offset Base
276 .long 3 ## HeaderData Atom Count
277 .short 1 ## DW_ATOM_die_offset
278 .short 6 ## DW_FORM_data4
279 .short 3 ## DW_ATOM_die_tag
280 .short 5 ## DW_FORM_data2
281 .short 4 ## DW_ATOM_type_flags
282 .short 11 ## DW_FORM_data1
285 .long 193495088 ## Hash in Bucket 0
286 .long -1304652851 ## Hash in Bucket 1
287 .set Lset5, Ltypes1-Ltypes_begin ## Offset in Bucket 0
289 .set Lset6, Ltypes0-Ltypes_begin ## Offset in Bucket 1
299 .long 46 ## unsigned int
306 .subsections_via_symbols
307 .section __DWARF,__debug_line,regular,debug