1 RUN: dsymutil -f -o - -oso-prepend-path=%p/.. %p/../Inputs/basic-lto.macho.x86_64 | llvm-dwarfdump -a - | FileCheck %s
2 RUN: dsymutil -oso-prepend-path=%p/.. -dump-debug-map %p/../Inputs/basic-lto.macho.x86_64 | dsymutil -f -o - -y - | llvm-dwarfdump -a - | FileCheck %s
4 RUN: dsymutil --linker llvm -f -o - -oso-prepend-path=%p/.. \
5 RUN: %p/../Inputs/basic-lto.macho.x86_64 | llvm-dwarfdump -a - | FileCheck %s
6 RUN: dsymutil --linker llvm -oso-prepend-path=%p/.. -dump-debug-map \
7 RUN: %p/../Inputs/basic-lto.macho.x86_64 | dsymutil -f -o - -y - | \
8 RUN: llvm-dwarfdump -a - | FileCheck %s
10 CHECK: file format Mach-O 64-bit x86-64
12 CHECK: debug_info contents
16 CHECK: DW_TAG_compile_unit
17 CHECK: DW_AT_producer ("Apple LLVM version 6.0 (clang-600.0.39) (based on LLVM 3.5svn)")
18 CHECK: DW_AT_language (DW_LANG_C99)
19 CHECK: DW_AT_name ("basic1.c")
20 CHECK: DW_AT_stmt_list (0x00000000)
21 CHECK: DW_AT_comp_dir ("/Inputs")
22 CHECK: DW_AT_low_pc (0x0000000100000f40)
23 CHECK: DW_TAG_subprogram
24 CHECK: DW_AT_name ("main")
25 CHECK: DW_AT_decl_file ("/Inputs{{[/\\]}}basic1.c")
26 CHECK: DW_AT_decl_line (23)
27 CHECK: DW_AT_prototyped (0x01)
28 CHECK: DW_AT_type (0x00000063
29 CHECK: DW_AT_external (0x01)
30 CHECK: DW_AT_accessibility (DW_ACCESS_public)
31 CHECK: DW_AT_low_pc (0x0000000100000f40)
32 CHECK: DW_AT_high_pc (0x0000000100000f4b)
33 CHECK: DW_AT_frame_base (DW_OP_reg6 RBP)
34 CHECK: DW_TAG_formal_parameter
35 CHECK: DW_AT_name ("argc")
36 CHECK: DW_AT_type (0x00000063
37 CHECK: DW_AT_location (DW_OP_reg5 RDI, DW_OP_piece 0x4)
38 CHECK: DW_TAG_formal_parameter
39 CHECK: DW_AT_name ("argv")
40 CHECK: DW_AT_type (0x0000006a
41 CHECK: DW_AT_location (DW_OP_reg4 RSI)
43 CHECK: DW_TAG_base_type
44 CHECK: DW_AT_name ("int")
45 CHECK: DW_AT_encoding (DW_ATE_signed)
46 CHECK: DW_AT_byte_size (0x04)
47 CHECK: DW_TAG_pointer_type
48 CHECK: DW_AT_type (0x0000006f
49 CHECK: DW_TAG_pointer_type
50 CHECK: DW_AT_type (0x00000074
51 CHECK: DW_TAG_const_type
52 CHECK: DW_AT_type (0x00000079
53 CHECK: DW_TAG_base_type
54 CHECK: DW_AT_name ("char")
55 CHECK: DW_AT_encoding (DW_ATE_signed_char)
56 CHECK: DW_AT_byte_size (0x01)
61 CHECK: DW_TAG_compile_unit
62 CHECK: DW_AT_producer ("Apple LLVM version 6.0 (clang-600.0.39) (based on LLVM 3.5svn)")
63 CHECK: DW_AT_name ("basic2.c")
64 CHECK: DW_AT_stmt_list (0x0000003e)
65 CHECK: DW_AT_comp_dir ("/Inputs")
66 CHECK: DW_AT_low_pc (0x0000000100000f50)
67 CHECK: DW_TAG_variable
68 CHECK: DW_AT_name ("private_int")
69 CHECK: DW_AT_type (0x0000000000000063
70 CHECK: DW_AT_decl_file ("/Inputs{{[/\\]}}basic2.c")
71 CHECK: DW_AT_location (DW_OP_addr 0x100001008)
72 CHECK: DW_TAG_variable
73 CHECK: DW_AT_name ("baz")
74 CHECK: DW_AT_type (0x0000000000000063
75 CHECK: DW_AT_location (DW_OP_addr 0x100001000)
76 CHECK: DW_TAG_subprogram
77 CHECK: DW_AT_name ("foo")
78 CHECK: DW_AT_type (0x0000000000000063
79 CHECK: DW_AT_low_pc (0x0000000100000f50)
80 CHECK: DW_AT_high_pc (0x0000000100000f89)
81 CHECK: DW_AT_frame_base (DW_OP_reg6 RBP)
82 CHECK: DW_TAG_formal_parameter
83 CHECK: DW_AT_name ("arg")
84 CHECK: DW_AT_type (0x0000000000000063
85 CHECK: DW_AT_location (0x00000000
86 CHECK: [0x0000000100000f50, 0x0000000100000f5e): DW_OP_reg5 RDI, DW_OP_piece 0x4)
87 CHECK:[[INC1:0x[0-9a-f]*]]{{.*}}DW_TAG_inlined_subroutine
88 CHECK: DW_AT_abstract_origin (0x00000128 "inc")
89 CHECK: DW_AT_low_pc (0x0000000100000f63)
90 CHECK: DW_AT_high_pc (0x0000000100000f72)
91 CHECK: DW_AT_call_line (20)
93 CHECK: DW_TAG_subprogram
94 CHECK: DW_AT_name ("inc")
95 CHECK: DW_AT_type (0x0000000000000063
96 CHECK: DW_AT_inline (DW_INL_inlined)
101 CHECK: DW_TAG_compile_unit
102 CHECK: DW_AT_producer ("Apple LLVM version 6.0 (clang-600.0.39) (based on LLVM 3.5svn)")
103 CHECK: DW_AT_name ("basic3.c")
104 CHECK: DW_AT_stmt_list (0x0000007e)
105 CHECK: DW_AT_comp_dir ("/Inputs")
106 CHECK: DW_AT_low_pc (0x0000000100000f90)
107 CHECK: DW_TAG_variable
108 CHECK: DW_AT_name ("val")
109 CHECK: DW_AT_type (0x00000176
110 CHECK: DW_AT_decl_file ("/Inputs{{[/\\]}}basic3.c")
111 CHECK: DW_AT_location (DW_OP_addr 0x100001004)
112 CHECK: DW_TAG_volatile_type
113 CHECK: DW_AT_type (0x0000000000000063
114 CHECK: DW_TAG_subprogram
115 CHECK: DW_AT_name ("bar")
116 CHECK: DW_AT_type (0x0000000000000063
117 CHECK: DW_AT_low_pc (0x0000000100000f90)
118 CHECK: DW_AT_high_pc (0x0000000100000fb4)
119 CHECK: DW_AT_frame_base (DW_OP_reg6 RBP)
120 CHECK: DW_TAG_formal_parameter
121 CHECK: DW_AT_name ("arg")
122 CHECK: DW_AT_type (0x0000000000000063
123 CHECK: DW_AT_location (0x00000025
124 CHECK: [0x0000000100000f90, 0x0000000100000f9f): DW_OP_reg5 RDI, DW_OP_piece 0x4
125 CHECK: [0x0000000100000fa9, 0x0000000100000fad): DW_OP_reg5 RDI, DW_OP_piece 0x4)
126 CHECK: DW_TAG_lexical_block
127 CHECK: DW_AT_low_pc (0x0000000100000f94)
128 CHECK: DW_AT_high_pc (0x0000000100000fa7)
129 CHECK:[[INC2:0x[0-9a-f]*]]{{.*}}DW_TAG_inlined_subroutine
130 CHECK: DW_AT_abstract_origin (0x000001d4 "inc")
131 CHECK: DW_AT_ranges (0x00000000
132 CHECK: [0x0000000100000f94, 0x0000000100000f9a)
133 CHECK: [0x0000000100000f9f, 0x0000000100000fa7))
136 CHECK: DW_TAG_subprogram
137 CHECK: DW_AT_name ("inc")
138 CHECK: DW_AT_type (0x0000000000000063
141 CHECK: .debug_loc contents:
142 CHECK-NEXT: 0x00000000:
143 CHECK-NEXT: (0x0000000000000000, 0x000000000000000e): DW_OP_reg5 RDI, DW_OP_piece 0x4
146 CHECK-NEXT: (0x0000000000000000, 0x000000000000000f): DW_OP_reg5 RDI, DW_OP_piece 0x4
147 CHECK-NEXT: (0x0000000000000019, 0x000000000000001d): DW_OP_reg5 RDI, DW_OP_piece 0x4
149 CHECK: .debug_aranges contents:
150 CHECK-NEXT: Address Range Header: length = 0x0000002c, format = DWARF32, version = 0x0002, cu_offset = 0x00000000, addr_size = 0x08, seg_size = 0x00
151 CHECK-NEXT: [0x0000000100000f40, 0x0000000100000f4b)
152 CHECK-NEXT: Address Range Header: length = 0x0000002c, format = DWARF32, version = 0x0002, cu_offset = 0x00000081, addr_size = 0x08, seg_size = 0x00
153 CHECK-NEXT: [0x0000000100000f50, 0x0000000100000f89)
154 CHECK-NEXT: Address Range Header: length = 0x0000002c, format = DWARF32, version = 0x0002, cu_offset = 0x0000013a, addr_size = 0x08, seg_size = 0x00
155 CHECK-NEXT: [0x0000000100000f90, 0x0000000100000fb4)
158 CHECK: .debug_line contents
159 CHECK: file_names[ 1]:
160 CHECK-NEXT: name: "basic1.c"
161 CHECK-NEXT: dir_index: 0
162 CHECK: 0x0000000100000f40 23 0 1 0 0 0 is_stmt
163 CHECK: 0x0000000100000f44 24 0 1 0 0 0 is_stmt prologue_end
164 CHECK: 0x0000000100000f4b 24 0 1 0 0 0 is_stmt end_sequence
166 CHECK: file_names[ 1]:
167 CHECK-NEXT: name: "basic2.c"
168 CHECK-NEXT: dir_index: 0
169 CHECK: 0x0000000100000f50 19 0 1 0 0 0 is_stmt
170 CHECK: 0x0000000100000f54 20 0 1 0 0 0 is_stmt prologue_end
171 CHECK: 0x0000000100000f63 15 0 1 0 0 0 is_stmt
172 CHECK: 0x0000000100000f72 20 0 1 0 0 0 is_stmt
173 CHECK: 0x0000000100000f89 20 0 1 0 0 0 is_stmt end_sequence
175 CHECK: file_names[ 1]:
176 CHECK-NEXT: name: "basic3.c"
177 CHECK-NEXT: dir_index: 0
178 CHECK: 0x0000000100000f90 16 0 1 0 0 0 is_stmt
179 CHECK: 0x0000000100000f94 12 0 1 0 0 0 is_stmt prologue_end
180 CHECK: 0x0000000100000f9a 17 0 1 0 0 0 is_stmt
181 CHECK: 0x0000000100000f9f 12 0 1 0 0 0 is_stmt
182 CHECK: 0x0000000100000fa7 20 0 1 0 0 0 is_stmt
183 CHECK: 0x0000000100000fa9 19 0 1 0 0 0 is_stmt
184 CHECK: 0x0000000100000fb2 20 0 1 0 0 0 is_stmt
185 CHECK: 0x0000000100000fb4 20 0 1 0 0 0 is_stmt end_sequence
187 CHECK-NOT: .debug_pubnames contents:
188 CHECK-NOT: .debug_pubtypes contents:
190 CHECK: .apple_names contents:
192 CHECK-NEXT: Magic: 0x48415348
193 CHECK-NEXT: Version: 0x1
194 CHECK-NEXT: Hash function: 0x0
195 CHECK-NEXT: Bucket count: 7
196 CHECK-NEXT: Hashes count: 7
197 CHECK-NEXT: HeaderData length: 12
199 CHECK-NEXT: DIE offset base: 0
200 CHECK-NEXT: Number of atoms: 1
201 CHECK-NEXT: Size of each hash data entry: 4
204 CHECK-NEXT: Type: DW_ATOM_die_offset
205 CHECK-NEXT: Form: DW_FORM_data4
208 CHECK-NEXT: Bucket 0 [
209 CHECK-NEXT: Hash 0xb8860c2 [
210 CHECK-NEXT: Name@0x74 {
211 CHECK-NEXT: String: 0x0000007e "baz"
213 CHECK-NEXT: Atom[0]: 0x000000c0
217 CHECK-NEXT: Hash 0xb88801f [
218 CHECK-NEXT: Name@0x84 {
219 CHECK-NEXT: String: 0x0000008a "inc"
221 CHECK-NEXT: Atom[0]: 0x00000110
224 CHECK-NEXT: Atom[0]: 0x000001c7
229 CHECK-NEXT: Bucket 1 [
232 CHECK-NEXT: Bucket 2 [
233 CHECK-NEXT: Hash 0xfed12c6a [
234 CHECK-NEXT: Name@0x98 {
235 CHECK-NEXT: String: 0x00000072 "private_int"
237 CHECK-NEXT: Atom[0]: 0x000000a7
242 CHECK-NEXT: Bucket 3 [
243 CHECK-NEXT: Hash 0xb88b5c8 [
244 CHECK-NEXT: Name@0xa8 {
245 CHECK-NEXT: String: 0x00000097 "val"
247 CHECK-NEXT: Atom[0]: 0x00000160
251 CHECK-NEXT: Hash 0x7c9a7f6a [
252 CHECK-NEXT: Name@0xb8 {
253 CHECK-NEXT: String: 0x00000051 "main"
255 CHECK-NEXT: Atom[0]: 0x00000026
260 CHECK-NEXT: Bucket 4 [
263 CHECK-NEXT: Bucket 5 [
264 CHECK-NEXT: Hash 0xb887389 [
265 CHECK-NEXT: Name@0xc8 {
266 CHECK-NEXT: String: 0x00000082 "foo"
268 CHECK-NEXT: Atom[0]: 0x000000d9
273 CHECK-NEXT: Bucket 6 [
274 CHECK-NEXT: Hash 0xb8860ba [
275 CHECK-NEXT: Name@0xd8 {
276 CHECK-NEXT: String: 0x0000009b "bar"
278 CHECK-NEXT: Atom[0]: 0x0000017f
284 CHECK: apple_types contents:
286 CHECK-NEXT: Magic: 0x48415348
287 CHECK-NEXT: Version: 0x1
288 CHECK-NEXT: Hash function: 0x0
289 CHECK-NEXT: Bucket count: 2
290 CHECK-NEXT: Hashes count: 2
291 CHECK-NEXT: HeaderData length: 24
293 CHECK-NEXT: DIE offset base: 0
294 CHECK-NEXT: Number of atoms: 4
295 CHECK-NEXT: Size of each hash data entry: 11
298 CHECK-NEXT: Type: DW_ATOM_die_offset
299 CHECK-NEXT: Form: DW_FORM_data4
302 CHECK-NEXT: Type: DW_ATOM_die_tag
303 CHECK-NEXT: Form: DW_FORM_data2
306 CHECK-NEXT: Type: DW_ATOM_type_flags
307 CHECK-NEXT: Form: DW_FORM_data1
310 CHECK-NEXT: Type: DW_ATOM_qual_name_hash
311 CHECK-NEXT: Form: DW_FORM_data4
314 CHECK-NEXT: Bucket 0 [
315 CHECK-NEXT: Hash 0xb888030 [
316 CHECK-NEXT: Name@0x44 {
317 CHECK-NEXT: String: 0x00000060 "int"
319 CHECK-NEXT: Atom[0]: 0x00000063
320 CHECK-NEXT: Atom[1]: 0x0024
321 CHECK-NEXT: Atom[2]: 0x00
322 CHECK-NEXT: Atom[3]: 0x0c3a28a4
327 CHECK-NEXT: Bucket 1 [
328 CHECK-NEXT: Hash 0x7c952063 [
329 CHECK-NEXT: Name@0x5b {
330 CHECK-NEXT: String: 0x00000064 "char"
332 CHECK-NEXT: Atom[0]: 0x00000079
333 CHECK-NEXT: Atom[1]: 0x0024
334 CHECK-NEXT: Atom[2]: 0x00
335 CHECK-NEXT: Atom[3]: 0x937bd757
341 CHECK: .apple_namespaces contents:
343 CHECK-NEXT: Magic: 0x48415348
344 CHECK-NEXT: Version: 0x1
345 CHECK-NEXT: Hash function: 0x0
346 CHECK-NEXT: Bucket count: 1
347 CHECK-NEXT: Hashes count: 0
348 CHECK-NEXT: HeaderData length: 12
350 CHECK-NEXT: DIE offset base: 0
351 CHECK-NEXT: Number of atoms: 1
352 CHECK-NEXT: Size of each hash data entry: 4
355 CHECK-NEXT: Type: DW_ATOM_die_offset
356 CHECK-NEXT: Form: DW_FORM_data4
359 CHECK-NEXT: Bucket 0 [
363 CHECK: .apple_objc contents:
365 CHECK-NEXT: Magic: 0x48415348
366 CHECK-NEXT: Version: 0x1
367 CHECK-NEXT: Hash function: 0x0
368 CHECK-NEXT: Bucket count: 1
369 CHECK-NEXT: Hashes count: 0
370 CHECK-NEXT: HeaderData length: 12
372 CHECK-NEXT: DIE offset base: 0
373 CHECK-NEXT: Number of atoms: 1
374 CHECK-NEXT: Size of each hash data entry: 4
377 CHECK-NEXT: Type: DW_ATOM_die_offset
378 CHECK-NEXT: Form: DW_FORM_data4
381 CHECK-NEXT: Bucket 0 [