1 # RUN: llvm-mc %s -filetype obj -triple x86_64-apple-darwin -o - \
2 # RUN: | not llvm-dwarfdump -lookup=0xffffffff - | \
3 # RUN: FileCheck %s --check-prefix=EMPTY --allow-empty
6 # RUN: llvm-mc %s -filetype obj -triple x86_64-apple-darwin -o - \
7 # RUN: | not llvm-dwarfdump -lookup=0xffffffffffffffff - | \
8 # RUN: FileCheck %s --check-prefix=EMPTY --allow-empty
11 # RUN: llvm-mc %s -filetype obj -triple x86_64-apple-darwin -o - \
12 # RUN: | llvm-dwarfdump -lookup=0x4 - | \
13 # RUN: FileCheck %s -check-prefixes=CHECK,LEX,A
15 # RUN: llvm-mc %s -filetype obj -triple x86_64-apple-darwin -o - \
16 # RUN: | llvm-dwarfdump -lookup=0xb - | \
17 # RUN: FileCheck %s -check-prefixes=CHECK,LEX,B
19 # RUN: llvm-mc %s -filetype obj -triple x86_64-apple-darwin -o - \
20 # RUN: | llvm-dwarfdump -lookup=0x14 - | \
21 # RUN: FileCheck %s -check-prefixes=CHECK,C
23 # CHECK: Compile Unit: length = 0x00000060, format = DWARF32, version = 0x0004, abbr_offset = 0x0000, addr_size = 0x08 (next unit at 0x00000064)
25 # CHECK: DW_TAG_compile_unit
26 # CHECK: DW_AT_name ("foo.c")
27 # CHECK: DW_AT_stmt_list (0x00000000)
28 # CHECK: DW_AT_low_pc (0x0000000000000000)
29 # CHECK: DW_AT_high_pc (0x0000000000000016)
31 # CHECK: DW_TAG_subprogram
32 # CHECK: DW_AT_low_pc (0x0000000000000000)
33 # CHECK: DW_AT_high_pc (0x0000000000000016)
34 # CHECK: DW_AT_name ("foo")
36 # LEX: DW_TAG_lexical_block
37 # LEX: DW_AT_low_pc (0x0000000000000004)
38 # LEX: DW_AT_high_pc (0x0000000000000014)
40 # A: Line info: file 'foo.c', line 3, column 9, start file 'foo.c', start line 1
41 # B: Line info: file 'foo.c', line 4, column 6, start file 'foo.c', start line 1
42 # C: Line info: file 'foo.c', line 6, column 1, start file 'foo.c', start line 1
44 .section __TEXT,__text,regular,pure_instructions
45 .macosx_version_min 10, 13
46 .globl _foo ## -- Begin function foo
51 .loc 1 1 0 ## foo.c:1:0
56 .cfi_def_cfa_offset 16
61 .cfi_def_cfa_register %rbp
63 .loc 1 3 9 prologue_end ## foo.c:3:9
65 .loc 1 4 6 ## foo.c:4:6
70 .loc 1 6 1 ## foo.c:6:1
77 .section __DWARF,__debug_str,regular,debug
79 .asciz "clang version 6.0.0 (trunk 314509) (llvm/trunk 314517)" ## string offset=0
80 .asciz "foo.c" ## string offset=55
81 .asciz "/private/tmp" ## string offset=61
82 .asciz "foo" ## string offset=74
83 .asciz "i" ## string offset=78
84 .asciz "int" ## string offset=80
85 .section __DWARF,__debug_abbrev,regular,debug
87 .byte 1 ## Abbreviation Code
88 .byte 17 ## DW_TAG_compile_unit
89 .byte 1 ## DW_CHILDREN_yes
90 .byte 37 ## DW_AT_producer
91 .byte 14 ## DW_FORM_strp
92 .byte 19 ## DW_AT_language
93 .byte 5 ## DW_FORM_data2
95 .byte 14 ## DW_FORM_strp
96 .byte 16 ## DW_AT_stmt_list
97 .byte 23 ## DW_FORM_sec_offset
98 .byte 27 ## DW_AT_comp_dir
99 .byte 14 ## DW_FORM_strp
100 .byte 17 ## DW_AT_low_pc
101 .byte 1 ## DW_FORM_addr
102 .byte 18 ## DW_AT_high_pc
103 .byte 6 ## DW_FORM_data4
106 .byte 2 ## Abbreviation Code
107 .byte 46 ## DW_TAG_subprogram
108 .byte 1 ## DW_CHILDREN_yes
109 .byte 17 ## DW_AT_low_pc
110 .byte 1 ## DW_FORM_addr
111 .byte 18 ## DW_AT_high_pc
112 .byte 6 ## DW_FORM_data4
113 .byte 64 ## DW_AT_frame_base
114 .byte 24 ## DW_FORM_exprloc
115 .byte 3 ## DW_AT_name
116 .byte 14 ## DW_FORM_strp
117 .byte 58 ## DW_AT_decl_file
118 .byte 11 ## DW_FORM_data1
119 .byte 59 ## DW_AT_decl_line
120 .byte 11 ## DW_FORM_data1
121 .byte 63 ## DW_AT_external
122 .byte 25 ## DW_FORM_flag_present
125 .byte 3 ## Abbreviation Code
126 .byte 11 ## DW_TAG_lexical_block
127 .byte 1 ## DW_CHILDREN_yes
128 .byte 17 ## DW_AT_low_pc
129 .byte 1 ## DW_FORM_addr
130 .byte 18 ## DW_AT_high_pc
131 .byte 6 ## DW_FORM_data4
134 .byte 4 ## Abbreviation Code
135 .byte 52 ## DW_TAG_variable
136 .byte 0 ## DW_CHILDREN_no
137 .byte 2 ## DW_AT_location
138 .byte 24 ## DW_FORM_exprloc
139 .byte 3 ## DW_AT_name
140 .byte 14 ## DW_FORM_strp
141 .byte 58 ## DW_AT_decl_file
142 .byte 11 ## DW_FORM_data1
143 .byte 59 ## DW_AT_decl_line
144 .byte 11 ## DW_FORM_data1
145 .byte 73 ## DW_AT_type
146 .byte 19 ## DW_FORM_ref4
149 .byte 5 ## Abbreviation Code
150 .byte 36 ## DW_TAG_base_type
151 .byte 0 ## DW_CHILDREN_no
152 .byte 3 ## DW_AT_name
153 .byte 14 ## DW_FORM_strp
154 .byte 62 ## DW_AT_encoding
155 .byte 11 ## DW_FORM_data1
156 .byte 11 ## DW_AT_byte_size
157 .byte 11 ## DW_FORM_data1
161 .section __DWARF,__debug_info,regular,debug
164 .long 96 ## Length of Unit
165 .short 4 ## DWARF version number
166 Lset0
= Lsection_abbrev-Lsection_abbrev
## Offset Into Abbrev. Section
168 .byte 8 ## Address Size (in bytes)
169 .byte 1 ## Abbrev [1] 0xb:0x59 DW_TAG_compile_unit
170 .long 0 ## DW_AT_producer
171 .short 12 ## DW_AT_language
172 .long 55 ## DW_AT_name
173 Lset1
= Lline_table_start0-Lsection_line
## DW_AT_stmt_list
175 .long 61 ## DW_AT_comp_dir
176 .quad Lfunc_begin0 ## DW_AT_low_pc
177 Lset2
= Lfunc_end0-Lfunc_begin0
## DW_AT_high_pc
179 .byte 2 ## Abbrev [2] 0x2a:0x32 DW_TAG_subprogram
180 .quad Lfunc_begin0 ## DW_AT_low_pc
181 Lset3
= Lfunc_end0-Lfunc_begin0
## DW_AT_high_pc
183 .byte 1 ## DW_AT_frame_base
185 .long 74 ## DW_AT_name
186 .byte 1 ## DW_AT_decl_file
187 .byte 1 ## DW_AT_decl_line
189 .byte 3 ## Abbrev [3] 0x3f:0x1c DW_TAG_lexical_block
190 .quad Ltmp0 ## DW_AT_low_pc
191 Lset4
= Ltmp1-Ltmp0
## DW_AT_high_pc
193 .byte 4 ## Abbrev [4] 0x4c:0xe DW_TAG_variable
194 .byte 2 ## DW_AT_location
197 .long 78 ## DW_AT_name
198 .byte 1 ## DW_AT_decl_file
199 .byte 3 ## DW_AT_decl_line
200 .long 92 ## DW_AT_type
201 .byte 0 ## End Of Children Mark
202 .byte 0 ## End Of Children Mark
203 .byte 5 ## Abbrev [5] 0x5c:0x7 DW_TAG_base_type
204 .long 80 ## DW_AT_name
205 .byte 5 ## DW_AT_encoding
206 .byte 4 ## DW_AT_byte_size
207 .byte 0 ## End Of Children Mark
208 .section __DWARF,__debug_ranges,regular,debug
210 .section __DWARF,__debug_macinfo,regular,debug
213 .byte 0 ## End Of Macro List Mark
214 .section __DWARF,__apple_names,regular,debug
216 .long 1212240712 ## Header Magic
217 .short 1 ## Header Version
218 .short 0 ## Header Hash Function
219 .long 1 ## Header Bucket Count
220 .long 1 ## Header Hash Count
221 .long 12 ## Header Data Length
222 .long 0 ## HeaderData Die Offset Base
223 .long 1 ## HeaderData Atom Count
224 .short 1 ## DW_ATOM_die_offset
225 .short 6 ## DW_FORM_data4
227 .long 193491849 ## Hash in Bucket 0
228 .long LNames0-Lnames_begin ## Offset in Bucket 0
234 .section __DWARF,__apple_objc,regular,debug
236 .long 1212240712 ## Header Magic
237 .short 1 ## Header Version
238 .short 0 ## Header Hash Function
239 .long 1 ## Header Bucket Count
240 .long 0 ## Header Hash Count
241 .long 12 ## Header Data Length
242 .long 0 ## HeaderData Die Offset Base
243 .long 1 ## HeaderData Atom Count
244 .short 1 ## DW_ATOM_die_offset
245 .short 6 ## DW_FORM_data4
247 .section __DWARF,__apple_namespac,regular,debug
249 .long 1212240712 ## Header Magic
250 .short 1 ## Header Version
251 .short 0 ## Header Hash Function
252 .long 1 ## Header Bucket Count
253 .long 0 ## Header Hash Count
254 .long 12 ## Header Data Length
255 .long 0 ## HeaderData Die Offset Base
256 .long 1 ## HeaderData Atom Count
257 .short 1 ## DW_ATOM_die_offset
258 .short 6 ## DW_FORM_data4
260 .section __DWARF,__apple_types,regular,debug
262 .long 1212240712 ## Header Magic
263 .short 1 ## Header Version
264 .short 0 ## Header Hash Function
265 .long 1 ## Header Bucket Count
266 .long 1 ## Header Hash Count
267 .long 20 ## Header Data Length
268 .long 0 ## HeaderData Die Offset Base
269 .long 3 ## HeaderData Atom Count
270 .short 1 ## DW_ATOM_die_offset
271 .short 6 ## DW_FORM_data4
272 .short 3 ## DW_ATOM_die_tag
273 .short 5 ## DW_FORM_data2
274 .short 4 ## DW_ATOM_type_flags
275 .short 11 ## DW_FORM_data1
277 .long 193495088 ## Hash in Bucket 0
278 .long Ltypes0-Ltypes_begin ## Offset in Bucket 0
287 .subsections_via_symbols
288 .section __DWARF,__debug_line,regular,debug