1# RUN: llvm-mc %s -filetype obj -triple x86_64-apple-darwin -o - \ 2# RUN: | llvm-dwarfdump --debug-info --debug-line - \ 3# RUN: | FileCheck %s 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 7 8# CHECK-NOT: .debug_abbrev contents: 9# 10# CHECK: .debug_info contents: 11# CHECK: DW_TAG_compile_unit 12# CHECK-NOT: DW_FORM 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 {{.*}} => 18 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 24 25# CHECK-NOT: {{.*}} contents: 26 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. 31 32 .section __TEXT,__text,regular,pure_instructions 33 .macosx_version_min 10, 12 34 .globl _main ## -- Begin function main 35 .p2align 4, 0x90 36_main: ## @main 37Lfunc_begin0: 38 .file 1 "brief.c" 39 .loc 1 1 0 ## brief.c:1:0 40 .cfi_startproc 41## %bb.0: ## %entry 42 pushq %rbp 43 .cfi_def_cfa_offset 16 44 .cfi_offset %rbp, -16 45 movq %rsp, %rbp 46 .cfi_def_cfa_register %rbp 47 xorl %eax, %eax 48Ltmp0: 49 .loc 1 1 12 prologue_end ## brief.c:1:12 50 popq %rbp 51 retq 52Ltmp1: 53Lfunc_end0: 54 .cfi_endproc 55 ## -- End function 56 .section __DWARF,__debug_str,regular,debug 57Linfo_string: 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 64Lsection_abbrev: 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 72 .byte 3 ## DW_AT_name 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 82 .byte 0 ## EOM(1) 83 .byte 0 ## EOM(2) 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 93 .byte 3 ## DW_AT_name 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 103 .byte 0 ## EOM(1) 104 .byte 0 ## EOM(2) 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 114 .byte 0 ## EOM(1) 115 .byte 0 ## EOM(2) 116 .byte 0 ## EOM(3) 117 .section __DWARF,__debug_info,regular,debug 118Lsection_info: 119Lcu_begin0: 120 .long 71 ## Length of Unit 121 .short 4 ## DWARF version number 122Lset0 = Lsection_abbrev-Lsection_abbrev ## Offset Into Abbrev. Section 123 .long Lset0 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 129Lset1 = Lline_table_start0-Lsection_line ## DW_AT_stmt_list 130 .long Lset1 131 .long 63 ## DW_AT_comp_dir 132 .quad Lfunc_begin0 ## DW_AT_low_pc 133Lset2 = Lfunc_end0-Lfunc_begin0 ## DW_AT_high_pc 134 .long Lset2 135 .byte 2 ## Abbrev [2] 0x2a:0x19 DW_TAG_subprogram 136 .quad Lfunc_begin0 ## DW_AT_low_pc 137Lset3 = Lfunc_end0-Lfunc_begin0 ## DW_AT_high_pc 138 .long Lset3 139 .byte 1 ## DW_AT_frame_base 140 .byte 86 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 145 ## DW_AT_external 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 152Ldebug_range: 153 .section __DWARF,__debug_macinfo,regular,debug 154Ldebug_macinfo: 155Lcu_macro_begin0: 156 .byte 0 ## End Of Macro List Mark 157 .section __DWARF,__apple_names,regular,debug 158Lnames_begin: 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 169 .long 0 ## Bucket 0 170 .long 2090499946 ## Hash in Bucket 0 171 .long LNames0-Lnames_begin ## Offset in Bucket 0 172LNames0: 173 .long 76 ## main 174 .long 1 ## Num DIEs 175 .long 42 176 .long 0 177 .section __DWARF,__apple_objc,regular,debug 178Lobjc_begin: 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 189 .long -1 ## Bucket 0 190 .section __DWARF,__apple_namespac,regular,debug 191Lnamespac_begin: 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 202 .long -1 ## Bucket 0 203 .section __DWARF,__apple_types,regular,debug 204Ltypes_begin: 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 219 .long 0 ## Bucket 0 220 .long 193495088 ## Hash in Bucket 0 221 .long Ltypes0-Ltypes_begin ## Offset in Bucket 0 222Ltypes0: 223 .long 81 ## int 224 .long 1 ## Num DIEs 225 .long 67 226 .short 36 227 .byte 0 228 .long 0 229 230.subsections_via_symbols 231 .section __DWARF,__debug_line,regular,debug 232Lsection_line: 233Lline_table_start0: 234