1*c9365251SDavid Stenberg# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux -dwarf-version=5 -o %t.o 2*c9365251SDavid Stenberg# RUN: llvm-dwarfdump %t.o | FileCheck %s 3*c9365251SDavid Stenberg# RUN: llvm-dwarfdump -verify %t.o 4*c9365251SDavid Stenberg 5*c9365251SDavid Stenberg# CHECK: DW_AT_location (DW_OP_constu 0x7b, DW_OP_convert 0x0, DW_OP_stack_value) 6*c9365251SDavid Stenberg 7*c9365251SDavid Stenberg .text 8*c9365251SDavid Stenberg .file "const.ll" 9*c9365251SDavid Stenberg .globl foo # -- Begin function foo 10*c9365251SDavid Stenberg .p2align 4, 0x90 11*c9365251SDavid Stenberg .type foo,@function 12*c9365251SDavid Stenbergfoo: # @foo 13*c9365251SDavid Stenberg.Lfoo$local: 14*c9365251SDavid Stenberg.Lfunc_begin0: 15*c9365251SDavid Stenberg .file 0 "/const.c" 16*c9365251SDavid Stenberg .loc 0 1 0 # const.c:1:0 17*c9365251SDavid Stenberg .cfi_startproc 18*c9365251SDavid Stenberg# %bb.0: # %entry 19*c9365251SDavid Stenberg .loc 0 3 1 prologue_end # const.c:3:1 20*c9365251SDavid Stenberg retq 21*c9365251SDavid Stenberg.Ltmp0: 22*c9365251SDavid Stenberg.Lfunc_end0: 23*c9365251SDavid Stenberg .size foo, .Lfunc_end0-foo 24*c9365251SDavid Stenberg .cfi_endproc 25*c9365251SDavid Stenberg # -- End function 26*c9365251SDavid Stenberg .section .debug_abbrev,"",@progbits 27*c9365251SDavid Stenberg .byte 1 # Abbreviation Code 28*c9365251SDavid Stenberg .byte 17 # DW_TAG_compile_unit 29*c9365251SDavid Stenberg .byte 1 # DW_CHILDREN_yes 30*c9365251SDavid Stenberg .byte 37 # DW_AT_producer 31*c9365251SDavid Stenberg .byte 37 # DW_FORM_strx1 32*c9365251SDavid Stenberg .byte 19 # DW_AT_language 33*c9365251SDavid Stenberg .byte 5 # DW_FORM_data2 34*c9365251SDavid Stenberg .byte 3 # DW_AT_name 35*c9365251SDavid Stenberg .byte 37 # DW_FORM_strx1 36*c9365251SDavid Stenberg .byte 114 # DW_AT_str_offsets_base 37*c9365251SDavid Stenberg .byte 23 # DW_FORM_sec_offset 38*c9365251SDavid Stenberg .byte 16 # DW_AT_stmt_list 39*c9365251SDavid Stenberg .byte 23 # DW_FORM_sec_offset 40*c9365251SDavid Stenberg .byte 27 # DW_AT_comp_dir 41*c9365251SDavid Stenberg .byte 37 # DW_FORM_strx1 42*c9365251SDavid Stenberg .byte 17 # DW_AT_low_pc 43*c9365251SDavid Stenberg .byte 27 # DW_FORM_addrx 44*c9365251SDavid Stenberg .byte 18 # DW_AT_high_pc 45*c9365251SDavid Stenberg .byte 6 # DW_FORM_data4 46*c9365251SDavid Stenberg .byte 115 # DW_AT_addr_base 47*c9365251SDavid Stenberg .byte 23 # DW_FORM_sec_offset 48*c9365251SDavid Stenberg .byte 0 # EOM(1) 49*c9365251SDavid Stenberg .byte 0 # EOM(2) 50*c9365251SDavid Stenberg .byte 2 # Abbreviation Code 51*c9365251SDavid Stenberg .byte 46 # DW_TAG_subprogram 52*c9365251SDavid Stenberg .byte 1 # DW_CHILDREN_yes 53*c9365251SDavid Stenberg .byte 17 # DW_AT_low_pc 54*c9365251SDavid Stenberg .byte 27 # DW_FORM_addrx 55*c9365251SDavid Stenberg .byte 18 # DW_AT_high_pc 56*c9365251SDavid Stenberg .byte 6 # DW_FORM_data4 57*c9365251SDavid Stenberg .byte 64 # DW_AT_frame_base 58*c9365251SDavid Stenberg .byte 24 # DW_FORM_exprloc 59*c9365251SDavid Stenberg .byte 122 # DW_AT_call_all_calls 60*c9365251SDavid Stenberg .byte 25 # DW_FORM_flag_present 61*c9365251SDavid Stenberg .byte 3 # DW_AT_name 62*c9365251SDavid Stenberg .byte 37 # DW_FORM_strx1 63*c9365251SDavid Stenberg .byte 58 # DW_AT_decl_file 64*c9365251SDavid Stenberg .byte 11 # DW_FORM_data1 65*c9365251SDavid Stenberg .byte 59 # DW_AT_decl_line 66*c9365251SDavid Stenberg .byte 11 # DW_FORM_data1 67*c9365251SDavid Stenberg .byte 63 # DW_AT_external 68*c9365251SDavid Stenberg .byte 25 # DW_FORM_flag_present 69*c9365251SDavid Stenberg .byte 0 # EOM(1) 70*c9365251SDavid Stenberg .byte 0 # EOM(2) 71*c9365251SDavid Stenberg .byte 3 # Abbreviation Code 72*c9365251SDavid Stenberg .byte 52 # DW_TAG_variable 73*c9365251SDavid Stenberg .byte 0 # DW_CHILDREN_no 74*c9365251SDavid Stenberg .byte 2 # DW_AT_location 75*c9365251SDavid Stenberg .byte 24 # DW_FORM_exprloc 76*c9365251SDavid Stenberg .byte 3 # DW_AT_name 77*c9365251SDavid Stenberg .byte 37 # DW_FORM_strx1 78*c9365251SDavid Stenberg .byte 58 # DW_AT_decl_file 79*c9365251SDavid Stenberg .byte 11 # DW_FORM_data1 80*c9365251SDavid Stenberg .byte 59 # DW_AT_decl_line 81*c9365251SDavid Stenberg .byte 11 # DW_FORM_data1 82*c9365251SDavid Stenberg .byte 73 # DW_AT_type 83*c9365251SDavid Stenberg .byte 19 # DW_FORM_ref4 84*c9365251SDavid Stenberg .byte 0 # EOM(1) 85*c9365251SDavid Stenberg .byte 0 # EOM(2) 86*c9365251SDavid Stenberg .byte 4 # Abbreviation Code 87*c9365251SDavid Stenberg .byte 36 # DW_TAG_base_type 88*c9365251SDavid Stenberg .byte 0 # DW_CHILDREN_no 89*c9365251SDavid Stenberg .byte 3 # DW_AT_name 90*c9365251SDavid Stenberg .byte 37 # DW_FORM_strx1 91*c9365251SDavid Stenberg .byte 62 # DW_AT_encoding 92*c9365251SDavid Stenberg .byte 11 # DW_FORM_data1 93*c9365251SDavid Stenberg .byte 11 # DW_AT_byte_size 94*c9365251SDavid Stenberg .byte 11 # DW_FORM_data1 95*c9365251SDavid Stenberg .byte 0 # EOM(1) 96*c9365251SDavid Stenberg .byte 0 # EOM(2) 97*c9365251SDavid Stenberg .byte 0 # EOM(3) 98*c9365251SDavid Stenberg .section .debug_info,"",@progbits 99*c9365251SDavid Stenberg.Lcu_begin0: 100*c9365251SDavid Stenberg .long .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit 101*c9365251SDavid Stenberg.Ldebug_info_start0: 102*c9365251SDavid Stenberg .short 5 # DWARF version number 103*c9365251SDavid Stenberg .byte 1 # DWARF Unit Type 104*c9365251SDavid Stenberg .byte 8 # Address Size (in bytes) 105*c9365251SDavid Stenberg .long .debug_abbrev # Offset Into Abbrev. Section 106*c9365251SDavid Stenberg .byte 1 # Abbrev [1] 0xc:0x36 DW_TAG_compile_unit 107*c9365251SDavid Stenberg .byte 0 # DW_AT_producer 108*c9365251SDavid Stenberg .short 12 # DW_AT_language 109*c9365251SDavid Stenberg .byte 1 # DW_AT_name 110*c9365251SDavid Stenberg .long .Lstr_offsets_base0 # DW_AT_str_offsets_base 111*c9365251SDavid Stenberg .long .Lline_table_start0 # DW_AT_stmt_list 112*c9365251SDavid Stenberg .byte 2 # DW_AT_comp_dir 113*c9365251SDavid Stenberg .byte 0 # DW_AT_low_pc 114*c9365251SDavid Stenberg .long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc 115*c9365251SDavid Stenberg .long .Laddr_table_base0 # DW_AT_addr_base 116*c9365251SDavid Stenberg .byte 2 # Abbrev [2] 0x23:0x1a DW_TAG_subprogram 117*c9365251SDavid Stenberg .byte 0 # DW_AT_low_pc 118*c9365251SDavid Stenberg .long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc 119*c9365251SDavid Stenberg .byte 1 # DW_AT_frame_base 120*c9365251SDavid Stenberg .byte 87 121*c9365251SDavid Stenberg # DW_AT_call_all_calls 122*c9365251SDavid Stenberg .byte 3 # DW_AT_name 123*c9365251SDavid Stenberg .byte 0 # DW_AT_decl_file 124*c9365251SDavid Stenberg .byte 1 # DW_AT_decl_line 125*c9365251SDavid Stenberg # DW_AT_external 126*c9365251SDavid Stenberg .byte 3 # Abbrev [3] 0x2e:0xe DW_TAG_variable 127*c9365251SDavid Stenberg .byte 5 # DW_AT_location 128*c9365251SDavid Stenberg .byte 16 129*c9365251SDavid Stenberg .byte 123 130*c9365251SDavid Stenberg .byte 168 131*c9365251SDavid Stenberg .byte 0 132*c9365251SDavid Stenberg .byte 159 133*c9365251SDavid Stenberg .byte 4 # DW_AT_name 134*c9365251SDavid Stenberg .byte 0 # DW_AT_decl_file 135*c9365251SDavid Stenberg .byte 2 # DW_AT_decl_line 136*c9365251SDavid Stenberg .long 61 # DW_AT_type 137*c9365251SDavid Stenberg .byte 0 # End Of Children Mark 138*c9365251SDavid Stenberg .byte 4 # Abbrev [4] 0x3d:0x4 DW_TAG_base_type 139*c9365251SDavid Stenberg .byte 5 # DW_AT_name 140*c9365251SDavid Stenberg .byte 5 # DW_AT_encoding 141*c9365251SDavid Stenberg .byte 4 # DW_AT_byte_size 142*c9365251SDavid Stenberg .byte 0 # End Of Children Mark 143*c9365251SDavid Stenberg.Ldebug_info_end0: 144*c9365251SDavid Stenberg .section .debug_str_offsets,"",@progbits 145*c9365251SDavid Stenberg .long 28 146*c9365251SDavid Stenberg .short 5 147*c9365251SDavid Stenberg .short 0 148*c9365251SDavid Stenberg.Lstr_offsets_base0: 149*c9365251SDavid Stenberg .section .debug_str,"MS",@progbits,1 150*c9365251SDavid Stenberg.Linfo_string0: 151*c9365251SDavid Stenberg .asciz "clang version 11.0.0" # string offset=0 152*c9365251SDavid Stenberg.Linfo_string1: 153*c9365251SDavid Stenberg .asciz "const.c" # string offset=21 154*c9365251SDavid Stenberg.Linfo_string2: 155*c9365251SDavid Stenberg .asciz "/" # string offset=29 156*c9365251SDavid Stenberg.Linfo_string3: 157*c9365251SDavid Stenberg .asciz "foo" # string offset=31 158*c9365251SDavid Stenberg.Linfo_string4: 159*c9365251SDavid Stenberg .asciz "local" # string offset=35 160*c9365251SDavid Stenberg.Linfo_string5: 161*c9365251SDavid Stenberg .asciz "int" # string offset=41 162*c9365251SDavid Stenberg .section .debug_str_offsets,"",@progbits 163*c9365251SDavid Stenberg .long .Linfo_string0 164*c9365251SDavid Stenberg .long .Linfo_string1 165*c9365251SDavid Stenberg .long .Linfo_string2 166*c9365251SDavid Stenberg .long .Linfo_string3 167*c9365251SDavid Stenberg .long .Linfo_string4 168*c9365251SDavid Stenberg .long .Linfo_string5 169*c9365251SDavid Stenberg .section .debug_addr,"",@progbits 170*c9365251SDavid Stenberg .long .Ldebug_addr_end0-.Ldebug_addr_start0 # Length of contribution 171*c9365251SDavid Stenberg.Ldebug_addr_start0: 172*c9365251SDavid Stenberg .short 5 # DWARF version number 173*c9365251SDavid Stenberg .byte 8 # Address size 174*c9365251SDavid Stenberg .byte 0 # Segment selector size 175*c9365251SDavid Stenberg.Laddr_table_base0: 176*c9365251SDavid Stenberg .quad .Lfunc_begin0 177*c9365251SDavid Stenberg.Ldebug_addr_end0: 178*c9365251SDavid Stenberg .ident "clang version 11.0.0" 179*c9365251SDavid Stenberg .section ".note.GNU-stack","",@progbits 180*c9365251SDavid Stenberg .section .debug_line,"",@progbits 181*c9365251SDavid Stenberg.Lline_table_start0: 182