1# RUN: llvm-mc -triple=x86_64-pc-linux -filetype=obj %s > %t 2# RUN: not llvm-dwarfdump %t 2>%t.err | FileCheck %s 3# RUN: FileCheck %s < %t.err -check-prefix=ERR 4 5# CHECK: DW_AT_name ("x0") 6# CHECK-NEXT: DW_AT_location (0x00000000 7# CHECK-NEXT: [0x0000000000000000, 0x0000000000000002): DW_OP_reg5 RDI 8# CHECK-NEXT: [0x0000000000000002, 0x0000000000000003): DW_OP_reg0 RAX) 9 10# CHECK: DW_AT_name ("x1") 11# CHECK-NEXT: DW_AT_location (0xdeadbeef: ) 12# ERR: error: offset 0xdeadbeef is beyond the end of data at 0x48 13 14# CHECK: DW_AT_name ("x2") 15# CHECK-NEXT: DW_AT_location (0x00000036: ) 16# ERR: error: unexpected end of data at offset 0x48 while reading [0x48, 0xdef5) 17 18 19 .type f,@function 20f: # @f 21.Lfunc_begin0: 22 movl %edi, %eax 23.Ltmp0: 24 retq 25.Ltmp1: 26.Lfunc_end0: 27 .size f, .Lfunc_end0-f 28 29 .section .debug_str,"MS",@progbits,1 30.Linfo_string0: 31 .asciz "Hand-written DWARF" 32.Linfo_string3: 33 .asciz "f" 34.Linfo_string4: 35 .asciz "int" 36.Lx0: 37 .asciz "x0" 38.Lx1: 39 .asciz "x1" 40.Lx2: 41 .asciz "x2" 42 43 .section .debug_loc,"",@progbits 44.Ldebug_loc0: 45 .quad .Lfunc_begin0-.Lfunc_begin0 46 .quad .Ltmp0-.Lfunc_begin0 47 .short 1 # Loc expr size 48 .byte 85 # super-register DW_OP_reg5 49 .quad .Ltmp0-.Lfunc_begin0 50 .quad .Lfunc_end0-.Lfunc_begin0 51 .short 1 # Loc expr size 52 .byte 80 # super-register DW_OP_reg0 53 .quad 0 54 .quad 0 55.Ldebug_loc2: 56 .quad .Lfunc_begin0-.Lfunc_begin0 57 .quad .Lfunc_end0-.Lfunc_begin0 58 .short 0xdead # Loc expr size 59 60 .section .debug_abbrev,"",@progbits 61 .byte 1 # Abbreviation Code 62 .byte 17 # DW_TAG_compile_unit 63 .byte 1 # DW_CHILDREN_yes 64 .byte 37 # DW_AT_producer 65 .byte 14 # DW_FORM_strp 66 .byte 19 # DW_AT_language 67 .byte 5 # DW_FORM_data2 68 .byte 17 # DW_AT_low_pc 69 .byte 1 # DW_FORM_addr 70 .byte 18 # DW_AT_high_pc 71 .byte 6 # DW_FORM_data4 72 .byte 0 # EOM(1) 73 .byte 0 # EOM(2) 74 .byte 2 # Abbreviation Code 75 .byte 46 # DW_TAG_subprogram 76 .byte 1 # DW_CHILDREN_yes 77 .byte 3 # DW_AT_name 78 .byte 14 # DW_FORM_strp 79 .byte 0 # EOM(1) 80 .byte 0 # EOM(2) 81 .byte 3 # Abbreviation Code 82 .byte 5 # DW_TAG_formal_parameter 83 .byte 0 # DW_CHILDREN_no 84 .byte 3 # DW_AT_name 85 .byte 14 # DW_FORM_strp 86 .byte 2 # DW_AT_location 87 .byte 23 # DW_FORM_sec_offset 88 .byte 0 # EOM(1) 89 .byte 0 # EOM(2) 90 .byte 4 # Abbreviation Code 91 .byte 36 # DW_TAG_base_type 92 .byte 0 # DW_CHILDREN_no 93 .byte 3 # DW_AT_name 94 .byte 14 # DW_FORM_strp 95 .byte 62 # DW_AT_encoding 96 .byte 11 # DW_FORM_data1 97 .byte 11 # DW_AT_byte_size 98 .byte 11 # DW_FORM_data1 99 .byte 0 # EOM(1) 100 .byte 0 # EOM(2) 101 .byte 0 # EOM(3) 102 103 .section .debug_info,"",@progbits 104.Lcu_begin0: 105 .long .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit 106.Ldebug_info_start0: 107 .short 4 # DWARF version number 108 .long .debug_abbrev # Offset Into Abbrev. Section 109 .byte 8 # Address Size (in bytes) 110 .byte 1 # Abbrev [1] 0xb:0x50 DW_TAG_compile_unit 111 .long .Linfo_string0 # DW_AT_producer 112 .short 12 # DW_AT_language 113 .quad 0 # DW_AT_low_pc 114 .long 0x100 # DW_AT_high_pc 115 .byte 2 # Abbrev [2] 0x2a:0x29 DW_TAG_subprogram 116 .long .Linfo_string3 # DW_AT_name 117 .byte 3 # Abbrev [3] DW_TAG_formal_parameter 118 .long .Lx0 # DW_AT_name 119 .long .Ldebug_loc0 # DW_AT_location 120 .byte 3 # Abbrev [3] DW_TAG_formal_parameter 121 .long .Lx1 # DW_AT_name 122 .long 0xdeadbeef # DW_AT_location 123 .byte 3 # Abbrev [3] DW_TAG_formal_parameter 124 .long .Lx2 # DW_AT_name 125 .long .Ldebug_loc2 # DW_AT_location 126 .byte 0 # End Of Children Mark 127 .byte 0 # End Of Children Mark 128.Ldebug_info_end0: 129