225 lines · plain
1# RUN: llvm-mc %s -filetype obj -triple x86_64-apple-darwin -o - \2# RUN: | not llvm-dwarfdump -v -verify - \3# RUN: | FileCheck %s4 5# CHECK: Verifying .debug_info Unit Header Chain...6# CHECK-NEXT: error: Units[2] - start offset: 0x000000687# CHECK-NEXT: note: The length for this unit is too large for the .debug_info provided.8# CHECK-NEXT: note: The unit type encoding is not valid.9 10# CHECK: Verifying non-dwo Units...11# CHECK: error: DIE has invalid DW_AT_stmt_list encoding:{{[[:space:]]}}12# CHECK-NEXT: 0x0000000c: DW_TAG_compile_unit [1] *13# CHECK-NEXT: DW_AT_producer [DW_FORM_strp] ( .debug_str[0x00000000] = "clang version 5.0.0 (trunk 308185) (llvm/trunk 308186)")14# CHECK-NEXT: DW_AT_language [DW_FORM_data2] (DW_LANG_C99)15# CHECK-NEXT: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000037] = "basic.c")16# CHECK-NEXT: DW_AT_stmt_list [DW_FORM_block4]17# CHECK-NEXT: DW_AT_comp_dir [DW_FORM_strp] ( .debug_str[0x0000003f] = "/Users/sgravani/Development/tests")18# CHECK-NEXT: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000)19# CHECK-NEXT: DW_AT_high_pc [DW_FORM_data4] (0x00000016){{[[:space:]]}}20# CHECK-NEXT: error: DIE has DW_AT_decl_file that references a file with index 1 and the compile unit has no line table{{[[:space:]]}}21# CHECK-NEXT: 0x0000002b: DW_TAG_subprogram [2] *22# CHECK-NEXT: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000)23# CHECK-NEXT: DW_AT_high_pc [DW_FORM_data4] (0x00000016)24# CHECK-NEXT: DW_AT_frame_base [DW_FORM_exprloc] (DW_OP_reg6)25# CHECK-NEXT: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000061] = "main")26# CHECK-NEXT: DW_AT_decl_file [DW_FORM_data1] (0x01)27# CHECK-NEXT: DW_AT_decl_line [DW_FORM_data1] (1)28# CHECK-NEXT: DW_AT_prototyped [DW_FORM_flag_present] (true)29# CHECK-NEXT: DW_AT_type [DW_FORM_ref4] (cu + 0x0052 => {0x00000052})30# CHECK-NEXT: DW_AT_external [DW_FORM_flag_present] (true){{[[:space:]]}}31# CHECK-NEXT: error: DIE has DW_AT_type with incompatible tag DW_TAG_null{{[[:space:]]}}32# CHECK-NEXT: 0x0000002b: DW_TAG_subprogram [2] *33# CHECK-NEXT: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000)34# CHECK-NEXT: DW_AT_high_pc [DW_FORM_data4] (0x00000016)35# CHECK-NEXT: DW_AT_frame_base [DW_FORM_exprloc] (DW_OP_reg6)36# CHECK-NEXT: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000061] = "main")37# CHECK-NEXT: DW_AT_decl_file [DW_FORM_data1] (0x01)38# CHECK-NEXT: DW_AT_decl_line [DW_FORM_data1] (1)39# CHECK-NEXT: DW_AT_prototyped [DW_FORM_flag_present] (true)40# CHECK-NEXT: DW_AT_type [DW_FORM_ref4] (cu + 0x0052 => {0x00000052})41# CHECK-NEXT: DW_AT_external [DW_FORM_flag_present] (true){{[[:space:]]}}42# CHECK-NEXT: error: DIE has DW_AT_decl_file that references a file with index 1 and the compile unit has no line table{{[[:space:]]}}43# CHECK-NEXT: 0x00000044: DW_TAG_variable [3]44# CHECK-NEXT: DW_AT_location [DW_FORM_exprloc] (DW_OP_fbreg -8)45# CHECK-NEXT: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000006a] = "a")46# CHECK-NEXT: DW_AT_decl_file [DW_FORM_data1] (0x01)47# CHECK-NEXT: DW_AT_decl_line [DW_FORM_data1] (2)48# CHECK-NEXT: DW_AT_use_location [DW_FORM_ref4] (cu + 0x0053 => {0x00000053}){{[[:space:]]}}49# CHECK-NEXT: Verifying unit: 2 / 2 50# CHECK-NEXT: error: Compilation unit root DIE is not a unit DIE: DW_TAG_null.51# CHECK-NEXT: error: Compilation unit type (DW_UT_compile) and root DIE (DW_TAG_null) do not match.52 53 54 .section __TEXT,__text,regular,pure_instructions55 .globl _main ## -- Begin function main56 .p2align 4, 0x9057_main: ## @main58Lfunc_begin0:59 .file 1 "basic.c"60 .loc 1 1 0 ## basic.c:1:061 .cfi_startproc62## %bb.0: ## %entry63 pushq %rbp64 .cfi_def_cfa_offset 1665 .cfi_offset %rbp, -1666 movq %rsp, %rbp67 .cfi_def_cfa_register %rbp68 xorl %eax, %eax69 movl $0, -4(%rbp)70Ltmp0:71 .loc 1 2 7 prologue_end ## basic.c:2:772 movl $1, -8(%rbp)73 .loc 1 3 3 ## basic.c:3:374 popq %rbp75 retq76Ltmp1:77Lfunc_end0:78 .cfi_endproc79 ## -- End function80 .section __DWARF,__debug_str,regular,debug81Linfo_string:82 .asciz "clang version 5.0.0 (trunk 308185) (llvm/trunk 308186)" ## string offset=083 .asciz "basic.c" ## string offset=5584 .asciz "/Users/sgravani/Development/tests" ## string offset=6385 .asciz "main" ## string offset=9786 .asciz "int" ## string offset=10287 .asciz "a" ## string offset=10688 .section __DWARF,__debug_abbrev,regular,debug89Lsection_abbrev:90 .byte 1 ## Abbreviation Code91 .byte 17 ## DW_TAG_compile_unit92 .byte 1 ## DW_CHILDREN_yes93 .byte 37 ## DW_AT_producer94 .byte 14 ## DW_FORM_strp95 .byte 19 ## DW_AT_language96 .byte 5 ## DW_FORM_data297 .byte 3 ## DW_AT_name98 .byte 14 ## DW_FORM_strp99 .byte 16 ## DW_AT_stmt_list100 .byte 4 ## DW_FORM_sec_offset -- error: DIE has invalid DW_AT_stmt_list encoding:101 .byte 27 ## DW_AT_comp_dir102 .byte 14 ## DW_FORM_strp103 .byte 17 ## DW_AT_low_pc104 .byte 1 ## DW_FORM_addr105 .byte 18 ## DW_AT_high_pc106 .byte 6 ## DW_FORM_data4107 .byte 0 ## EOM(1)108 .byte 0 ## EOM(2)109 .byte 2 ## Abbreviation Code110 .byte 46 ## DW_TAG_subprogram111 .byte 1 ## DW_CHILDREN_yes112 .byte 17 ## DW_AT_low_pc113 .byte 1 ## DW_FORM_addr114 .byte 18 ## DW_AT_high_pc115 .byte 6 ## DW_FORM_data4116 .byte 64 ## DW_AT_frame_base117 .byte 24 ## DW_FORM_exprloc118 .byte 3 ## DW_AT_name119 .byte 14 ## DW_FORM_strp120 .byte 58 ## DW_AT_decl_file121 .byte 11 ## DW_FORM_data1122 .byte 59 ## DW_AT_decl_line123 .byte 11 ## DW_FORM_data1124 .byte 39 ## DW_AT_prototyped125 .byte 25 ## DW_FORM_flag_present126 .byte 73 ## DW_AT_type127 .byte 19 ## DW_FORM_ref4128 .byte 63 ## DW_AT_external129 .byte 25 ## DW_FORM_flag_present130 .byte 0 ## EOM(1)131 .byte 0 ## EOM(2)132 .byte 3 ## Abbreviation Code133 .byte 52 ## DW_TAG_variable134 .byte 0 ## DW_CHILDREN_no135 .byte 2 ## DW_AT_location136 .byte 24 ## DW_FORM_exprloc137 .byte 3 ## DW_AT_name138 .byte 14 ## DW_FORM_strp139 .byte 58 ## DW_AT_decl_file140 .byte 11 ## DW_FORM_data1141 .byte 59 ## DW_AT_decl_line142 .byte 11 ## DW_FORM_data1143 .byte 74 ## DW_AT_type144 .byte 19 ## DW_FORM_ref4145 .byte 0 ## EOM(1)146 .byte 0 ## EOM(2)147 .byte 4 ## Abbreviation Code148 .byte 36 ## DW_TAG_base_type149 .byte 0 ## DW_CHILDREN_no150 .byte 3 ## DW_AT_name151 .byte 14 ## DW_FORM_strp152 .byte 62 ## DW_AT_encoding153 .byte 11 ## DW_FORM_data1154 .byte 11 ## DW_AT_byte_size155 .byte 11 ## DW_FORM_data1156 .byte 0 ## EOM(1)157 .byte 0 ## EOM(2)158 .byte 0 ## EOM(3)159 .section __DWARF,__debug_info,regular,debug160Lsection_info:161Lcu_begin0:162 .long 87 ## Length of Unit163 .short 5 ## DWARF version number164 .byte 1 ## DWARF Unit Type165 .byte 8 ## Address Size (in bytes)166Lset0 = Lsection_abbrev-Lsection_abbrev ## Offset Into Abbrev. Section167 .long Lset0168 .byte 1 ## Abbrev [1] 0xc:0x4f DW_TAG_compile_unit169 .long 0 ## DW_AT_producer170 .short 12 ## DW_AT_language171 .long 55 ## DW_AT_name172Lset1 = Lline_table_start0-Lsection_line ## DW_AT_stmt_list173 .long Lset1174 .long 63 ## DW_AT_comp_dir175 .quad Lfunc_begin0 ## DW_AT_low_pc176Lset2 = Lfunc_end0-Lfunc_begin0 ## DW_AT_high_pc177 .long Lset2178 .byte 2 ## Abbrev [2] 0x2b:0x28 DW_TAG_subprogram179 .quad Lfunc_begin0 ## DW_AT_low_pc180Lset3 = Lfunc_end0-Lfunc_begin0 ## DW_AT_high_pc181 .long Lset3182 .byte 1 ## DW_AT_frame_base183 .byte 86184 .long 97 ## DW_AT_name185 .byte 1 ## DW_AT_decl_file186 .byte 1 ## DW_AT_decl_line187 ## DW_AT_prototyped188 .long 82 ## DW_AT_type189 ## DW_AT_external190 .byte 3 ## Abbrev [3] 0x44:0xe DW_TAG_variable191 .byte 2 ## DW_AT_location192 .byte 145193 .byte 120194 .long 106 ## DW_AT_name195 .byte 1 ## DW_AT_decl_file196 .byte 2 ## DW_AT_decl_line197 .long 83 ## DW_AT_type198 .byte 0 ## End Of Children Mark199 .byte 4 ## Abbrev [4] 0x53:0x7 DW_TAG_base_type200 .long 102 ## DW_AT_name201 .byte 5 ## DW_AT_encoding202 .byte 4 ## DW_AT_byte_size203 .byte 0 ## End Of Children Mark204Lcu_begin1:205 .long 9 ## Length of Unit206 .short 5 ## DWARF version number207 .byte 1 ## DWARF Unit Type208 .byte 4 ## Address Size (in bytes)209 .long 0 ## Abbrev offset210 .byte 0211Ltu_begin0:212 .long 26 ## Length of Unit -- Error: The length for this unit is too large for the .debug_info provided.213 .short 5 ## DWARF version number214 .byte 0 ## DWARF Unit Type215 .byte 4 ## Address Size (in bytes)216 .long 0217 .quad 0218 .long 0219 .byte 0220 221.subsections_via_symbols222 .section __DWARF,__debug_line,regular,debug223Lsection_line:224Lline_table_start0:225