1# RUN: llvm-mc -triple x86_64-pc-linux %s -o %t.o -filetype=obj 2# RUN: llvm-dwarfdump -debug-info -verify %t.o | FileCheck %s 3 4# CHECK-NOT: error: 5 6# Assembly generated from this source: 7# struct t1 { int i; }; 8# t1 v1; 9# and compiled with -g -fdebug-types-section 10# 11# This demonstrates that llvm-dwarfdump --verify does not try to apply offsets found in the .debug_type 12 13 .text 14 .file "test.cpp" 15 .file 1 "/usr/local/google/home/blaikie/dev/scratch" "test.cpp" 16 .section .debug_types,"G",@progbits,14297044602779165170,comdat 17 .long .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit 18.Ldebug_info_start0: 19 .short 4 # DWARF version number 20 .long .debug_abbrev # Offset Into Abbrev. Section 21 .byte 8 # Address Size (in bytes) 22 .quad -4149699470930386446 # Type Signature 23 .long 30 # Type DIE Offset 24 .byte 1 # Abbrev [1] 0x17:0x25 DW_TAG_type_unit 25 .short 33 # DW_AT_language 26 .long .Lline_table_start0 # DW_AT_stmt_list 27 .byte 2 # Abbrev [2] 0x1e:0x16 DW_TAG_structure_type 28 .byte 5 # DW_AT_calling_convention 29 .long .Linfo_string6 # DW_AT_name 30 .byte 4 # DW_AT_byte_size 31 .byte 1 # DW_AT_decl_file 32 .byte 1 # DW_AT_decl_line 33 .byte 3 # Abbrev [3] 0x27:0xc DW_TAG_member 34 .long .Linfo_string4 # DW_AT_name 35 .long 52 # DW_AT_type 36 .byte 1 # DW_AT_decl_file 37 .byte 1 # DW_AT_decl_line 38 .byte 0 # DW_AT_data_member_location 39 .byte 0 # End Of Children Mark 40 .byte 4 # Abbrev [4] 0x34:0x7 DW_TAG_base_type 41 .long .Linfo_string5 # DW_AT_name 42 .byte 5 # DW_AT_encoding 43 .byte 4 # DW_AT_byte_size 44 .byte 0 # End Of Children Mark 45.Ldebug_info_end0: 46 .type v1,@object # @v1 47 .bss 48 .globl v1 49 .p2align 2 50v1: 51 .zero 4 52 .size v1, 4 53 54 .section .debug_abbrev,"",@progbits 55 .byte 1 # Abbreviation Code 56 .byte 65 # DW_TAG_type_unit 57 .byte 1 # DW_CHILDREN_yes 58 .byte 19 # DW_AT_language 59 .byte 5 # DW_FORM_data2 60 .byte 16 # DW_AT_stmt_list 61 .byte 23 # DW_FORM_sec_offset 62 .byte 0 # EOM(1) 63 .byte 0 # EOM(2) 64 .byte 2 # Abbreviation Code 65 .byte 19 # DW_TAG_structure_type 66 .byte 1 # DW_CHILDREN_yes 67 .byte 54 # DW_AT_calling_convention 68 .byte 11 # DW_FORM_data1 69 .byte 3 # DW_AT_name 70 .byte 14 # DW_FORM_strp 71 .byte 11 # DW_AT_byte_size 72 .byte 11 # DW_FORM_data1 73 .byte 58 # DW_AT_decl_file 74 .byte 11 # DW_FORM_data1 75 .byte 59 # DW_AT_decl_line 76 .byte 11 # DW_FORM_data1 77 .byte 0 # EOM(1) 78 .byte 0 # EOM(2) 79 .byte 3 # Abbreviation Code 80 .byte 13 # DW_TAG_member 81 .byte 0 # DW_CHILDREN_no 82 .byte 3 # DW_AT_name 83 .byte 14 # DW_FORM_strp 84 .byte 73 # DW_AT_type 85 .byte 19 # DW_FORM_ref4 86 .byte 58 # DW_AT_decl_file 87 .byte 11 # DW_FORM_data1 88 .byte 59 # DW_AT_decl_line 89 .byte 11 # DW_FORM_data1 90 .byte 56 # DW_AT_data_member_location 91 .byte 11 # DW_FORM_data1 92 .byte 0 # EOM(1) 93 .byte 0 # EOM(2) 94 .byte 4 # Abbreviation Code 95 .byte 36 # DW_TAG_base_type 96 .byte 0 # DW_CHILDREN_no 97 .byte 3 # DW_AT_name 98 .byte 14 # DW_FORM_strp 99 .byte 62 # DW_AT_encoding 100 .byte 11 # DW_FORM_data1 101 .byte 11 # DW_AT_byte_size 102 .byte 11 # DW_FORM_data1 103 .byte 0 # EOM(1) 104 .byte 0 # EOM(2) 105 .byte 5 # Abbreviation Code 106 .byte 17 # DW_TAG_compile_unit 107 .byte 1 # DW_CHILDREN_yes 108 .byte 37 # DW_AT_producer 109 .byte 14 # DW_FORM_strp 110 .byte 19 # DW_AT_language 111 .byte 5 # DW_FORM_data2 112 .byte 3 # DW_AT_name 113 .byte 14 # DW_FORM_strp 114 .byte 16 # DW_AT_stmt_list 115 .byte 23 # DW_FORM_sec_offset 116 .byte 27 # DW_AT_comp_dir 117 .byte 14 # DW_FORM_strp 118 .byte 0 # EOM(1) 119 .byte 0 # EOM(2) 120 .byte 6 # Abbreviation Code 121 .byte 52 # DW_TAG_variable 122 .byte 0 # DW_CHILDREN_no 123 .byte 3 # DW_AT_name 124 .byte 14 # DW_FORM_strp 125 .byte 73 # DW_AT_type 126 .byte 19 # DW_FORM_ref4 127 .byte 63 # DW_AT_external 128 .byte 25 # DW_FORM_flag_present 129 .byte 58 # DW_AT_decl_file 130 .byte 11 # DW_FORM_data1 131 .byte 59 # DW_AT_decl_line 132 .byte 11 # DW_FORM_data1 133 .byte 2 # DW_AT_location 134 .byte 24 # DW_FORM_exprloc 135 .byte 0 # EOM(1) 136 .byte 0 # EOM(2) 137 .byte 7 # Abbreviation Code 138 .byte 19 # DW_TAG_structure_type 139 .byte 0 # DW_CHILDREN_no 140 .byte 60 # DW_AT_declaration 141 .byte 25 # DW_FORM_flag_present 142 .byte 105 # DW_AT_signature 143 .byte 32 # DW_FORM_ref_sig8 144 .byte 0 # EOM(1) 145 .byte 0 # EOM(2) 146 .byte 0 # EOM(3) 147 .section .debug_info,"",@progbits 148.Lcu_begin0: 149 .long .Ldebug_info_end1-.Ldebug_info_start1 # Length of Unit 150.Ldebug_info_start1: 151 .short 4 # DWARF version number 152 .long .debug_abbrev # Offset Into Abbrev. Section 153 .byte 8 # Address Size (in bytes) 154 .byte 5 # Abbrev [5] 0xb:0x32 DW_TAG_compile_unit 155 .long .Linfo_string0 # DW_AT_producer 156 .short 33 # DW_AT_language 157 .long .Linfo_string1 # DW_AT_name 158 .long .Lline_table_start0 # DW_AT_stmt_list 159 .long .Linfo_string2 # DW_AT_comp_dir 160 .byte 6 # Abbrev [6] 0x1e:0x15 DW_TAG_variable 161 .long .Linfo_string3 # DW_AT_name 162 .long 51 # DW_AT_type 163 # DW_AT_external 164 .byte 1 # DW_AT_decl_file 165 .byte 2 # DW_AT_decl_line 166 .byte 9 # DW_AT_location 167 .byte 3 168 .quad v1 169 .byte 7 # Abbrev [7] 0x33:0x9 DW_TAG_structure_type 170 # DW_AT_declaration 171 .quad -4149699470930386446 # DW_AT_signature 172 .byte 0 # End Of Children Mark 173.Ldebug_info_end1: 174 .section .debug_str,"MS",@progbits,1 175.Linfo_string0: 176 .asciz "clang version 14.0.0 (git@github.com:llvm/llvm-project.git 7f00c7ce4b186ab8ba2ae66c82efdcf908c61019)" # string offset=0 177.Linfo_string1: 178 .asciz "test.cpp" # string offset=101 179.Linfo_string2: 180 .asciz "/usr/local/google/home/blaikie/dev/scratch" # string offset=110 181.Linfo_string3: 182 .asciz "v1" # string offset=153 183.Linfo_string4: 184 .asciz "i" # string offset=156 185.Linfo_string5: 186 .asciz "int" # string offset=158 187.Linfo_string6: 188 .asciz "t1" # string offset=162 189 .ident "clang version 14.0.0 (git@github.com:llvm/llvm-project.git 7f00c7ce4b186ab8ba2ae66c82efdcf908c61019)" 190 .section ".note.GNU-stack","",@progbits 191 .addrsig 192 .section .debug_line,"",@progbits 193.Lline_table_start0: 194