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
5 # RUN: llvm-dwarfdump --debug-info=0x00000032 -p -parent-recurse-depth 1 -c %t | FileCheck %s --check-prefix=ONEPARENT
7 # PARENTS: DW_TAG_compile_unit
8 # PARENTS: DW_TAG_enumeration_type
9 # PARENTS-NOT: DW_TAG_enumerator
11 # ONEPARENT-NOT: DW_TAG_compile_unit
12 # ONEPARENT: DW_TAG_enumeration_type
13 # ONEPARENT: DW_TAG_enumerator
15 # CHILDREN-NOT: DW_TAG_compile_unit
16 # CHILDREN: DW_TAG_enumerator
17 # CHILDREN: DW_AT_name ("first")
18 # CHILDREN: DW_TAG_enumerator
19 # CHILDREN: DW_AT_name ("second")
21 # BOTH: DW_TAG_compile_unit
22 # BOTH: DW_TAG_enumeration_type
23 # BOTH: DW_TAG_enumerator
24 # BOTH: DW_AT_name ("first")
25 # BOTH: DW_TAG_enumerator
26 # BOTH: DW_AT_name ("second")
28 # BOTH-NOT: DW_TAG_compile_unit
29 # BOTH-NOT: DW_TAG_enumeration_type
30 # BOTH-NOT: DW_TAG_enumerator
32 .section __TEXT,__text,regular,pure_instructions
33 .file 1 "/private/tmp" "/tmp/enum.c"
34 .globl _main ## -- Begin function main
38 .loc 1 4 0 ## /tmp/enum.c:4:0
42 .cfi_def_cfa_offset 16
45 .cfi_def_cfa_register %rbp
48 .loc 1 5 7 prologue_end ## /tmp/enum.c:5:7
50 .loc 1 6 10 ## /tmp/enum.c:6:10
52 .loc 1 6 3 is_stmt 0 ## /tmp/enum.c:6:3
59 .section __DWARF,__debug_str,regular,debug
61 .asciz "clang version 7.0.0 " ## string offset=0
62 .asciz "/tmp/enum.c" ## string offset=21
63 .asciz "/private/tmp" ## string offset=33
64 .asciz "unsigned int" ## string offset=46
65 .asciz "first" ## string offset=59
66 .asciz "second" ## string offset=65
67 .asciz "main" ## string offset=72
68 .asciz "int" ## string offset=77
69 .asciz "var" ## string offset=81
70 .section __DWARF,__debug_abbrev,regular,debug
72 .byte 1 ## Abbreviation Code
73 .byte 17 ## DW_TAG_compile_unit
74 .byte 1 ## DW_CHILDREN_yes
75 .byte 37 ## DW_AT_producer
76 .byte 14 ## DW_FORM_strp
77 .byte 19 ## DW_AT_language
78 .byte 5 ## DW_FORM_data2
80 .byte 14 ## DW_FORM_strp
81 .byte 16 ## DW_AT_stmt_list
82 .byte 23 ## DW_FORM_sec_offset
83 .byte 27 ## DW_AT_comp_dir
84 .byte 14 ## DW_FORM_strp
85 .byte 17 ## DW_AT_low_pc
86 .byte 1 ## DW_FORM_addr
87 .byte 18 ## DW_AT_high_pc
88 .byte 6 ## DW_FORM_data4
91 .byte 2 ## Abbreviation Code
92 .byte 4 ## DW_TAG_enumeration_type
93 .byte 1 ## DW_CHILDREN_yes
94 .byte 73 ## DW_AT_type
95 .byte 19 ## DW_FORM_ref4
96 .byte 11 ## DW_AT_byte_size
97 .byte 11 ## DW_FORM_data1
98 .byte 58 ## DW_AT_decl_file
99 .byte 11 ## DW_FORM_data1
100 .byte 59 ## DW_AT_decl_line
101 .byte 11 ## DW_FORM_data1
104 .byte 3 ## Abbreviation Code
105 .byte 40 ## DW_TAG_enumerator
106 .byte 0 ## DW_CHILDREN_no
107 .byte 3 ## DW_AT_name
108 .byte 14 ## DW_FORM_strp
109 .byte 28 ## DW_AT_const_value
110 .byte 15 ## DW_FORM_udata
113 .byte 4 ## Abbreviation Code
114 .byte 36 ## DW_TAG_base_type
115 .byte 0 ## DW_CHILDREN_no
116 .byte 3 ## DW_AT_name
117 .byte 14 ## DW_FORM_strp
118 .byte 62 ## DW_AT_encoding
119 .byte 11 ## DW_FORM_data1
120 .byte 11 ## DW_AT_byte_size
121 .byte 11 ## DW_FORM_data1
124 .byte 5 ## Abbreviation Code
125 .byte 46 ## DW_TAG_subprogram
126 .byte 1 ## DW_CHILDREN_yes
127 .byte 17 ## DW_AT_low_pc
128 .byte 1 ## DW_FORM_addr
129 .byte 18 ## DW_AT_high_pc
130 .byte 6 ## DW_FORM_data4
131 .byte 64 ## DW_AT_frame_base
132 .byte 24 ## DW_FORM_exprloc
133 .byte 3 ## DW_AT_name
134 .byte 14 ## DW_FORM_strp
135 .byte 58 ## DW_AT_decl_file
136 .byte 11 ## DW_FORM_data1
137 .byte 59 ## DW_AT_decl_line
138 .byte 11 ## DW_FORM_data1
139 .byte 73 ## DW_AT_type
140 .byte 19 ## DW_FORM_ref4
141 .byte 63 ## DW_AT_external
142 .byte 25 ## DW_FORM_flag_present
145 .byte 6 ## Abbreviation Code
146 .byte 52 ## DW_TAG_variable
147 .byte 0 ## DW_CHILDREN_no
148 .byte 2 ## DW_AT_location
149 .byte 24 ## DW_FORM_exprloc
150 .byte 3 ## DW_AT_name
151 .byte 14 ## DW_FORM_strp
152 .byte 58 ## DW_AT_decl_file
153 .byte 11 ## DW_FORM_data1
154 .byte 59 ## DW_AT_decl_line
155 .byte 11 ## DW_FORM_data1
156 .byte 73 ## DW_AT_type
157 .byte 19 ## DW_FORM_ref4
161 .section __DWARF,__debug_info,regular,debug
164 .long 114 ## Length of Unit
165 .short 4 ## DWARF version number
166 .set Lset0, Lsection_abbrev-Lsection_abbrev ## Offset Into Abbrev. Section
168 .byte 8 ## Address Size (in bytes)
169 .byte 1 ## Abbrev [1] 0xb:0x6b DW_TAG_compile_unit
170 .long 0 ## DW_AT_producer
171 .short 12 ## DW_AT_language
172 .long 21 ## DW_AT_name
173 .set Lset1, Lline_table_start0-Lsection_line ## DW_AT_stmt_list
175 .long 33 ## DW_AT_comp_dir
176 .quad Lfunc_begin0 ## DW_AT_low_pc
177 .set Lset2, Lfunc_end0-Lfunc_begin0 ## DW_AT_high_pc
179 .byte 2 ## Abbrev [2] 0x2a:0x15 DW_TAG_enumeration_type
180 .long 63 ## DW_AT_type
181 .byte 4 ## DW_AT_byte_size
182 .byte 1 ## DW_AT_decl_file
183 .byte 1 ## DW_AT_decl_line
184 .byte 3 ## Abbrev [3] 0x32:0x6 DW_TAG_enumerator
185 .long 59 ## DW_AT_name
186 .byte 0 ## DW_AT_const_value
187 .byte 3 ## Abbrev [3] 0x38:0x6 DW_TAG_enumerator
188 .long 65 ## DW_AT_name
189 .byte 1 ## DW_AT_const_value
190 .byte 0 ## End Of Children Mark
191 .byte 4 ## Abbrev [4] 0x3f:0x7 DW_TAG_base_type
192 .long 46 ## DW_AT_name
193 .byte 7 ## DW_AT_encoding
194 .byte 4 ## DW_AT_byte_size
195 .byte 5 ## Abbrev [5] 0x46:0x28 DW_TAG_subprogram
196 .quad Lfunc_begin0 ## DW_AT_low_pc
197 .set Lset3, Lfunc_end0-Lfunc_begin0 ## DW_AT_high_pc
199 .byte 1 ## DW_AT_frame_base
201 .long 72 ## DW_AT_name
202 .byte 1 ## DW_AT_decl_file
203 .byte 3 ## DW_AT_decl_line
204 .long 110 ## DW_AT_type
206 .byte 6 ## Abbrev [6] 0x5f:0xe DW_TAG_variable
207 .byte 2 ## DW_AT_location
210 .long 81 ## DW_AT_name
211 .byte 1 ## DW_AT_decl_file
212 .byte 5 ## DW_AT_decl_line
213 .long 110 ## DW_AT_type
214 .byte 0 ## End Of Children Mark
215 .byte 4 ## Abbrev [4] 0x6e:0x7 DW_TAG_base_type
216 .long 77 ## DW_AT_name
217 .byte 5 ## DW_AT_encoding
218 .byte 4 ## DW_AT_byte_size
219 .byte 0 ## End Of Children Mark
220 .section __DWARF,__debug_ranges,regular,debug
222 .section __DWARF,__debug_macinfo,regular,debug
224 .byte 0 ## End Of Macro List Mark
225 .section __DWARF,__apple_names,regular,debug
227 .long 1212240712 ## Header Magic
228 .short 1 ## Header Version
229 .short 0 ## Header Hash Function
230 .long 1 ## Header Bucket Count
231 .long 1 ## Header Hash Count
232 .long 12 ## Header Data Length
233 .long 0 ## HeaderData Die Offset Base
234 .long 1 ## HeaderData Atom Count
235 .short 1 ## DW_ATOM_die_offset
236 .short 6 ## DW_FORM_data4
238 .long 2090499946 ## Hash in Bucket 0
239 .set Lset4, LNames0-Lnames_begin ## Offset in Bucket 0
246 .section __DWARF,__apple_objc,regular,debug
248 .long 1212240712 ## Header Magic
249 .short 1 ## Header Version
250 .short 0 ## Header Hash Function
251 .long 1 ## Header Bucket Count
252 .long 0 ## Header Hash Count
253 .long 12 ## Header Data Length
254 .long 0 ## HeaderData Die Offset Base
255 .long 1 ## HeaderData Atom Count
256 .short 1 ## DW_ATOM_die_offset
257 .short 6 ## DW_FORM_data4
259 .section __DWARF,__apple_namespac,regular,debug
261 .long 1212240712 ## Header Magic
262 .short 1 ## Header Version
263 .short 0 ## Header Hash Function
264 .long 1 ## Header Bucket Count
265 .long 0 ## Header Hash Count
266 .long 12 ## Header Data Length
267 .long 0 ## HeaderData Die Offset Base
268 .long 1 ## HeaderData Atom Count
269 .short 1 ## DW_ATOM_die_offset
270 .short 6 ## DW_FORM_data4
272 .section __DWARF,__apple_types,regular,debug
274 .long 1212240712 ## Header Magic
275 .short 1 ## Header Version
276 .short 0 ## Header Hash Function
277 .long 2 ## Header Bucket Count
278 .long 2 ## Header Hash Count
279 .long 20 ## Header Data Length
280 .long 0 ## HeaderData Die Offset Base
281 .long 3 ## HeaderData Atom Count
282 .short 1 ## DW_ATOM_die_offset
283 .short 6 ## DW_FORM_data4
284 .short 3 ## DW_ATOM_die_tag
285 .short 5 ## DW_FORM_data2
286 .short 4 ## DW_ATOM_type_flags
287 .short 11 ## DW_FORM_data1
290 .long 193495088 ## Hash in Bucket 0
291 .long -1304652851 ## Hash in Bucket 1
292 .set Lset5, Ltypes1-Ltypes_begin ## Offset in Bucket 0
294 .set Lset6, Ltypes0-Ltypes_begin ## Offset in Bucket 1
304 .long 46 ## unsigned int
311 .subsections_via_symbols
312 .section __DWARF,__debug_line,regular,debug