1 # RUN: llvm-mc %s -filetype obj -triple x86_64-apple-darwin -o - \
2 # RUN: | llvm-dwarfdump --debug-info --debug-line - \
4 # RUN: llvm-mc %s -filetype obj -triple x86_64-apple-darwin -o - \
5 # RUN: | llvm-dwarfdump --debug-info --debug-line - -o %t
6 # RUN: cat %t | FileCheck %s
8 # CHECK-NOT: .debug_abbrev contents:
10 # CHECK: .debug_info contents:
11 # CHECK: DW_TAG_compile_unit
13 # CHECK: DW_AT_name ("brief.c")
14 # CHECK: DW_AT_name ("main")
15 # CHECK: DW_AT_name ("int")
16 # CHECK-NOT: debug_str
17 # CHECK-NOT: DW_AT_type {{.*}} =>
19 # CHECK: Address Line Column File ISA Discriminator Flags
20 # CHECK-NEXT:------------------ ------ ------ ------ --- ------------- -------------
21 # CHECK-NEXT:0x0000000000000000 1 0 1 0 0 is_stmt
22 # CHECK-NEXT:0x0000000000000006 1 12 1 0 0 is_stmt prologue_end
23 # CHECK-NEXT:0x0000000000000008 1 12 1 0 0 is_stmt end_sequence
25 # CHECK-NOT: {{.*}} contents:
27 # This test is meant to verify that without specifying -verbose DW_FORMs and
28 # abbreviation codes are hidden from .debug_info section. Furthermore it
29 # verifies that it also hides .debug_str and die reference offsets into the CU
30 # and that the .debug_line table is printed rather than the opcodes.
32 .section __TEXT,__text,regular,pure_instructions
33 .macosx_version_min 10, 12
34 .globl _main ## -- Begin function main
39 .loc 1 1 0 ## brief.c:1:0
43 .cfi_def_cfa_offset 16
46 .cfi_def_cfa_register %rbp
49 .loc 1 1 12 prologue_end ## brief.c:1:12
56 .section __DWARF,__debug_str,regular,debug
58 .asciz "clang version 6.0.0 (trunk 311115) (llvm/trunk 311188)" ## string offset=0
59 .asciz "brief.c" ## string offset=55
60 .asciz "/private/tmp" ## string offset=63
61 .asciz "main" ## string offset=76
62 .asciz "int" ## string offset=81
63 .section __DWARF,__debug_abbrev,regular,debug
65 .byte 1 ## Abbreviation Code
66 .byte 17 ## DW_TAG_compile_unit
67 .byte 1 ## DW_CHILDREN_yes
68 .byte 37 ## DW_AT_producer
69 .byte 14 ## DW_FORM_strp
70 .byte 19 ## DW_AT_language
71 .byte 5 ## DW_FORM_data2
73 .byte 14 ## DW_FORM_strp
74 .byte 16 ## DW_AT_stmt_list
75 .byte 23 ## DW_FORM_sec_offset
76 .byte 27 ## DW_AT_comp_dir
77 .byte 14 ## DW_FORM_strp
78 .byte 17 ## DW_AT_low_pc
79 .byte 1 ## DW_FORM_addr
80 .byte 18 ## DW_AT_high_pc
81 .byte 6 ## DW_FORM_data4
84 .byte 2 ## Abbreviation Code
85 .byte 46 ## DW_TAG_subprogram
86 .byte 0 ## DW_CHILDREN_no
87 .byte 17 ## DW_AT_low_pc
88 .byte 1 ## DW_FORM_addr
89 .byte 18 ## DW_AT_high_pc
90 .byte 6 ## DW_FORM_data4
91 .byte 64 ## DW_AT_frame_base
92 .byte 24 ## DW_FORM_exprloc
94 .byte 14 ## DW_FORM_strp
95 .byte 58 ## DW_AT_decl_file
96 .byte 11 ## DW_FORM_data1
97 .byte 59 ## DW_AT_decl_line
98 .byte 11 ## DW_FORM_data1
99 .byte 73 ## DW_AT_type
100 .byte 19 ## DW_FORM_ref4
101 .byte 63 ## DW_AT_external
102 .byte 25 ## DW_FORM_flag_present
105 .byte 3 ## Abbreviation Code
106 .byte 36 ## DW_TAG_base_type
107 .byte 0 ## DW_CHILDREN_no
108 .byte 3 ## DW_AT_name
109 .byte 14 ## DW_FORM_strp
110 .byte 62 ## DW_AT_encoding
111 .byte 11 ## DW_FORM_data1
112 .byte 11 ## DW_AT_byte_size
113 .byte 11 ## DW_FORM_data1
117 .section __DWARF,__debug_info,regular,debug
120 .long 71 ## Length of Unit
121 .short 4 ## DWARF version number
122 Lset0
= Lsection_abbrev-Lsection_abbrev
## Offset Into Abbrev. Section
124 .byte 8 ## Address Size (in bytes)
125 .byte 1 ## Abbrev [1] 0xb:0x40 DW_TAG_compile_unit
126 .long 0 ## DW_AT_producer
127 .short 12 ## DW_AT_language
128 .long 55 ## DW_AT_name
129 Lset1
= Lline_table_start0-Lsection_line
## DW_AT_stmt_list
131 .long 63 ## DW_AT_comp_dir
132 .quad Lfunc_begin0 ## DW_AT_low_pc
133 Lset2
= Lfunc_end0-Lfunc_begin0
## DW_AT_high_pc
135 .byte 2 ## Abbrev [2] 0x2a:0x19 DW_TAG_subprogram
136 .quad Lfunc_begin0 ## DW_AT_low_pc
137 Lset3
= Lfunc_end0-Lfunc_begin0
## DW_AT_high_pc
139 .byte 1 ## DW_AT_frame_base
141 .long 76 ## DW_AT_name
142 .byte 1 ## DW_AT_decl_file
143 .byte 1 ## DW_AT_decl_line
144 .long 67 ## DW_AT_type
146 .byte 3 ## Abbrev [3] 0x43:0x7 DW_TAG_base_type
147 .long 81 ## DW_AT_name
148 .byte 5 ## DW_AT_encoding
149 .byte 4 ## DW_AT_byte_size
150 .byte 0 ## End Of Children Mark
151 .section __DWARF,__debug_ranges,regular,debug
153 .section __DWARF,__debug_macinfo,regular,debug
156 .byte 0 ## End Of Macro List Mark
157 .section __DWARF,__apple_names,regular,debug
159 .long 1212240712 ## Header Magic
160 .short 1 ## Header Version
161 .short 0 ## Header Hash Function
162 .long 1 ## Header Bucket Count
163 .long 1 ## Header Hash Count
164 .long 12 ## Header Data Length
165 .long 0 ## HeaderData Die Offset Base
166 .long 1 ## HeaderData Atom Count
167 .short 1 ## DW_ATOM_die_offset
168 .short 6 ## DW_FORM_data4
170 .long 2090499946 ## Hash in Bucket 0
171 .long LNames0-Lnames_begin ## Offset in Bucket 0
177 .section __DWARF,__apple_objc,regular,debug
179 .long 1212240712 ## Header Magic
180 .short 1 ## Header Version
181 .short 0 ## Header Hash Function
182 .long 1 ## Header Bucket Count
183 .long 0 ## Header Hash Count
184 .long 12 ## Header Data Length
185 .long 0 ## HeaderData Die Offset Base
186 .long 1 ## HeaderData Atom Count
187 .short 1 ## DW_ATOM_die_offset
188 .short 6 ## DW_FORM_data4
190 .section __DWARF,__apple_namespac,regular,debug
192 .long 1212240712 ## Header Magic
193 .short 1 ## Header Version
194 .short 0 ## Header Hash Function
195 .long 1 ## Header Bucket Count
196 .long 0 ## Header Hash Count
197 .long 12 ## Header Data Length
198 .long 0 ## HeaderData Die Offset Base
199 .long 1 ## HeaderData Atom Count
200 .short 1 ## DW_ATOM_die_offset
201 .short 6 ## DW_FORM_data4
203 .section __DWARF,__apple_types,regular,debug
205 .long 1212240712 ## Header Magic
206 .short 1 ## Header Version
207 .short 0 ## Header Hash Function
208 .long 1 ## Header Bucket Count
209 .long 1 ## Header Hash Count
210 .long 20 ## Header Data Length
211 .long 0 ## HeaderData Die Offset Base
212 .long 3 ## HeaderData Atom Count
213 .short 1 ## DW_ATOM_die_offset
214 .short 6 ## DW_FORM_data4
215 .short 3 ## DW_ATOM_die_tag
216 .short 5 ## DW_FORM_data2
217 .short 4 ## DW_ATOM_type_flags
218 .short 11 ## DW_FORM_data1
220 .long 193495088 ## Hash in Bucket 0
221 .long Ltypes0-Ltypes_begin ## Offset in Bucket 0
230 .subsections_via_symbols
231 .section __DWARF,__debug_line,regular,debug