blob: 7f9058c26351c2139e95da6da6d8edbaa61de297 [file] [log] [blame]
# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux -o %t.o
# RUN: llvm-dwarfdump %t.o | FileCheck %s
# RUN: not llvm-dwarfdump -verify %t.o
# CHECK: DW_AT_location (DW_OP_addr 0x{{[0-9a-f]+}}, DW_OP_convert <invalid base_type ref: 0x{{[0-9a-f]+}}>, DW_OP_convert (0x{{[0-9a-f]+}}) "DW_ATE_signed_32")
.text
.file "dbg.g.c"
.file 1 "/tmp/dbg.g.c"
.type global,@object # @global
.data
.globl global
.p2align 2
global:
.long 255 # 0xff
.size global, 4
.section .debug_str,"MS",@progbits,1
.Linfo_string0:
.asciz "clang version 9.0.0 (trunk 354265) (llvm/trunk 354264)" # string offset=0
.Linfo_string1:
.asciz "dbg.g.c" # string offset=55
.Linfo_string2:
.asciz "/tmp" # string offset=63
.Linfo_string3:
.asciz "global" # string offset=68
.Linfo_string4:
.asciz "int" # string offset=75
.Linfo_string5:
.asciz "DW_ATE_signed_32" # string offset=79
.Linfo_string6:
.asciz "DW_ATE_signed_8" # string offset=96
.section .debug_abbrev,"",@progbits
.byte 1 # Abbreviation Code
.byte 17 # DW_TAG_compile_unit
.byte 1 # DW_CHILDREN_yes
.byte 37 # DW_AT_producer
.byte 14 # DW_FORM_strp
.byte 19 # DW_AT_language
.byte 5 # DW_FORM_data2
.byte 3 # DW_AT_name
.byte 14 # DW_FORM_strp
.byte 16 # DW_AT_stmt_list
.byte 23 # DW_FORM_sec_offset
.byte 27 # DW_AT_comp_dir
.byte 14 # DW_FORM_strp
.byte 0 # EOM(1)
.byte 0 # EOM(2)
.byte 2 # Abbreviation Code
.byte 36 # DW_TAG_base_type
.byte 0 # DW_CHILDREN_no
.byte 3 # DW_AT_name
.byte 14 # DW_FORM_strp
.byte 62 # DW_AT_encoding
.byte 11 # DW_FORM_data1
.byte 11 # DW_AT_byte_size
.byte 11 # DW_FORM_data1
.byte 0 # EOM(1)
.byte 0 # EOM(2)
.byte 3 # Abbreviation Code
.byte 52 # DW_TAG_variable
.byte 0 # DW_CHILDREN_no
.byte 3 # DW_AT_name
.byte 14 # DW_FORM_strp
.byte 73 # DW_AT_type
.byte 19 # DW_FORM_ref4
.byte 63 # DW_AT_external
.byte 25 # DW_FORM_flag_present
.byte 58 # DW_AT_decl_file
.byte 11 # DW_FORM_data1
.byte 59 # DW_AT_decl_line
.byte 11 # DW_FORM_data1
.byte 2 # DW_AT_location
.byte 24 # DW_FORM_exprloc
.byte 0 # EOM(1)
.byte 0 # EOM(2)
.byte 0 # EOM(3)
.section .debug_info,"",@progbits
.Lcu_begin0:
.long .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit
.Ldebug_info_start0:
.short 4 # DWARF version number
.long .debug_abbrev # Offset Into Abbrev. Section
.byte 8 # Address Size (in bytes)
.byte 1 # Abbrev [1] 0xb:0x48 DW_TAG_compile_unit
.long .Linfo_string0 # DW_AT_producer
.short 12 # DW_AT_language
.long .Linfo_string1 # DW_AT_name
.long .Lline_table_start0 # DW_AT_stmt_list
.long .Linfo_string2 # DW_AT_comp_dir
.byte 2 # Abbrev [2] 0x1e:0x7 DW_TAG_base_type
.long .Linfo_string6 # DW_AT_name
.byte 5 # DW_AT_encoding
.byte 1 # DW_AT_byte_size
.byte 2 # Abbrev [2] 0x25:0x7 DW_TAG_base_type
.long .Linfo_string5 # DW_AT_name
.byte 5 # DW_AT_encoding
.byte 4 # DW_AT_byte_size
.byte 3 # Abbrev [3] 0x2c:0x1f DW_TAG_variable
.long .Linfo_string3 # DW_AT_name
.long 75 # DW_AT_type
# DW_AT_external
.byte 1 # DW_AT_decl_file
.byte 1 # DW_AT_decl_line
.byte 19 # DW_AT_location
.byte 3
.quad global
.byte 168
.asciz "\235\200\200" ### This offset is off by one to test the invalid base_type ref printout
.byte 168
.asciz "\245\200\200"
.byte 2 # Abbrev [2] 0x4b:0x7 DW_TAG_base_type
.long .Linfo_string4 # DW_AT_name
.byte 5 # DW_AT_encoding
.byte 4 # DW_AT_byte_size
.byte 0 # End Of Children Mark
.Ldebug_info_end0:
.section .debug_macinfo,"",@progbits
.byte 0 # End Of Macro List Mark
.ident "clang version 9.0.0 (trunk 354265) (llvm/trunk 354264)"
.section ".note.GNU-stack","",@progbits
.section .debug_line,"",@progbits
.Lline_table_start0: