235 lines · plain
1# REQUIRES: x862## Test clang-17-generated DW_TAG_subprogram, which do not contain DW_IDX_parent3## attributes.4 5# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o6# RUN: ld.lld --debug-names %t.o -o %t7# RUN: llvm-dwarfdump --debug-info --debug-names %t | FileCheck %s --check-prefix=DWARF8 9# DWARF: 0x00000023: DW_TAG_namespace10# DWARF: 0x00000025: DW_TAG_subprogram11 12# DWARF: String: {{.*}} "fa"13# DWARF-NEXT: Entry @ 0x71 {14# DWARF-NEXT: Abbrev: 0x115# DWARF-NEXT: Tag: DW_TAG_subprogram16# DWARF-NEXT: DW_IDX_die_offset: 0x0000002517# DWARF-NEXT: DW_IDX_compile_unit: 0x0018# DWARF-NEXT: }19# DWARF: String: {{.*}} "ns"20# DWARF-NEXT: Entry @ 0x78 {21# DWARF-NEXT: Abbrev: 0x222# DWARF-NEXT: Tag: DW_TAG_namespace23# DWARF-NEXT: DW_IDX_die_offset: 0x0000002324# DWARF-NEXT: DW_IDX_compile_unit: 0x0025# DWARF-NEXT: }26 27.ifdef GEN28//--- a.cc29namespace ns {30void fa() {}31}32//--- gen33clang-17 --target=x86_64-linux -S -O1 -g -gpubnames a.cc -o -34.endif35 .text36 .file "a.cc"37 .globl _ZN2ns2faEv # -- Begin function _ZN2ns2faEv38 .p2align 4, 0x9039 .type _ZN2ns2faEv,@function40_ZN2ns2faEv: # @_ZN2ns2faEv41.Lfunc_begin0:42 .file 0 "/proc/self/cwd" "a.cc" md5 0xb3281d5b5a0b2997d7d59d49bc91227443 .cfi_startproc44# %bb.0:45 .loc 0 2 12 prologue_end # a.cc:2:1246 retq47.Ltmp0:48.Lfunc_end0:49 .size _ZN2ns2faEv, .Lfunc_end0-_ZN2ns2faEv50 .cfi_endproc51 # -- End function52 .section .debug_abbrev,"",@progbits53 .byte 1 # Abbreviation Code54 .byte 17 # DW_TAG_compile_unit55 .byte 1 # DW_CHILDREN_yes56 .byte 37 # DW_AT_producer57 .byte 37 # DW_FORM_strx158 .byte 19 # DW_AT_language59 .byte 5 # DW_FORM_data260 .byte 3 # DW_AT_name61 .byte 37 # DW_FORM_strx162 .byte 114 # DW_AT_str_offsets_base63 .byte 23 # DW_FORM_sec_offset64 .byte 16 # DW_AT_stmt_list65 .byte 23 # DW_FORM_sec_offset66 .byte 27 # DW_AT_comp_dir67 .byte 37 # DW_FORM_strx168 .byte 17 # DW_AT_low_pc69 .byte 27 # DW_FORM_addrx70 .byte 18 # DW_AT_high_pc71 .byte 6 # DW_FORM_data472 .byte 115 # DW_AT_addr_base73 .byte 23 # DW_FORM_sec_offset74 .byte 0 # EOM(1)75 .byte 0 # EOM(2)76 .byte 2 # Abbreviation Code77 .byte 57 # DW_TAG_namespace78 .byte 1 # DW_CHILDREN_yes79 .byte 3 # DW_AT_name80 .byte 37 # DW_FORM_strx181 .byte 0 # EOM(1)82 .byte 0 # EOM(2)83 .byte 3 # Abbreviation Code84 .byte 46 # DW_TAG_subprogram85 .byte 0 # DW_CHILDREN_no86 .byte 17 # DW_AT_low_pc87 .byte 27 # DW_FORM_addrx88 .byte 18 # DW_AT_high_pc89 .byte 6 # DW_FORM_data490 .byte 64 # DW_AT_frame_base91 .byte 24 # DW_FORM_exprloc92 .byte 122 # DW_AT_call_all_calls93 .byte 25 # DW_FORM_flag_present94 .byte 110 # DW_AT_linkage_name95 .byte 37 # DW_FORM_strx196 .byte 3 # DW_AT_name97 .byte 37 # DW_FORM_strx198 .byte 58 # DW_AT_decl_file99 .byte 11 # DW_FORM_data1100 .byte 59 # DW_AT_decl_line101 .byte 11 # DW_FORM_data1102 .byte 63 # DW_AT_external103 .byte 25 # DW_FORM_flag_present104 .byte 0 # EOM(1)105 .byte 0 # EOM(2)106 .byte 0 # EOM(3)107 .section .debug_info,"",@progbits108.Lcu_begin0:109 .long .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit110.Ldebug_info_start0:111 .short 5 # DWARF version number112 .byte 1 # DWARF Unit Type113 .byte 8 # Address Size (in bytes)114 .long .debug_abbrev # Offset Into Abbrev. Section115 .byte 1 # Abbrev [1] 0xc:0x27 DW_TAG_compile_unit116 .byte 0 # DW_AT_producer117 .short 33 # DW_AT_language118 .byte 1 # DW_AT_name119 .long .Lstr_offsets_base0 # DW_AT_str_offsets_base120 .long .Lline_table_start0 # DW_AT_stmt_list121 .byte 2 # DW_AT_comp_dir122 .byte 0 # DW_AT_low_pc123 .long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc124 .long .Laddr_table_base0 # DW_AT_addr_base125 .byte 2 # Abbrev [2] 0x23:0xf DW_TAG_namespace126 .byte 3 # DW_AT_name127 .byte 3 # Abbrev [3] 0x25:0xc DW_TAG_subprogram128 .byte 0 # DW_AT_low_pc129 .long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc130 .byte 1 # DW_AT_frame_base131 .byte 87132 # DW_AT_call_all_calls133 .byte 4 # DW_AT_linkage_name134 .byte 5 # DW_AT_name135 .byte 0 # DW_AT_decl_file136 .byte 2 # DW_AT_decl_line137 # DW_AT_external138 .byte 0 # End Of Children Mark139 .byte 0 # End Of Children Mark140.Ldebug_info_end0:141 .section .debug_str_offsets,"",@progbits142 .long 28 # Length of String Offsets Set143 .short 5144 .short 0145.Lstr_offsets_base0:146 .section .debug_str,"MS",@progbits,1147.Linfo_string0:148 .byte 0 # string offset=0149.Linfo_string1:150 .asciz "a.cc" # string offset=1151.Linfo_string2:152 .asciz "/proc/self/cwd" # string offset=6153.Linfo_string3:154 .asciz "ns" # string offset=21155.Linfo_string4:156 .asciz "fa" # string offset=24157.Linfo_string5:158 .asciz "_ZN2ns2faEv" # string offset=27159 .section .debug_str_offsets,"",@progbits160 .long .Linfo_string0161 .long .Linfo_string1162 .long .Linfo_string2163 .long .Linfo_string3164 .long .Linfo_string5165 .long .Linfo_string4166 .section .debug_addr,"",@progbits167 .long .Ldebug_addr_end0-.Ldebug_addr_start0 # Length of contribution168.Ldebug_addr_start0:169 .short 5 # DWARF version number170 .byte 8 # Address size171 .byte 0 # Segment selector size172.Laddr_table_base0:173 .quad .Lfunc_begin0174.Ldebug_addr_end0:175 .section .debug_names,"",@progbits176 .long .Lnames_end0-.Lnames_start0 # Header: unit length177.Lnames_start0:178 .short 5 # Header: version179 .short 0 # Header: padding180 .long 1 # Header: compilation unit count181 .long 0 # Header: local type unit count182 .long 0 # Header: foreign type unit count183 .long 3 # Header: bucket count184 .long 3 # Header: name count185 .long .Lnames_abbrev_end0-.Lnames_abbrev_start0 # Header: abbreviation table size186 .long 8 # Header: augmentation string size187 .ascii "LLVM0700" # Header: augmentation string188 .long .Lcu_begin0 # Compilation unit 0189 .long 0 # Bucket 0190 .long 1 # Bucket 1191 .long 3 # Bucket 2192 .long 5863372 # Hash in Bucket 1193 .long 5863654 # Hash in Bucket 1194 .long -1413999533 # Hash in Bucket 2195 .long .Linfo_string4 # String in Bucket 1: fa196 .long .Linfo_string3 # String in Bucket 1: ns197 .long .Linfo_string5 # String in Bucket 2: _ZN2ns2faEv198 .long .Lnames1-.Lnames_entries0 # Offset in Bucket 1199 .long .Lnames0-.Lnames_entries0 # Offset in Bucket 1200 .long .Lnames2-.Lnames_entries0 # Offset in Bucket 2201.Lnames_abbrev_start0:202 .byte 46 # Abbrev code203 .byte 46 # DW_TAG_subprogram204 .byte 3 # DW_IDX_die_offset205 .byte 19 # DW_FORM_ref4206 .byte 0 # End of abbrev207 .byte 0 # End of abbrev208 .byte 57 # Abbrev code209 .byte 57 # DW_TAG_namespace210 .byte 3 # DW_IDX_die_offset211 .byte 19 # DW_FORM_ref4212 .byte 0 # End of abbrev213 .byte 0 # End of abbrev214 .byte 0 # End of abbrev list215.Lnames_abbrev_end0:216.Lnames_entries0:217.Lnames1:218 .byte 46 # Abbreviation code219 .long 37 # DW_IDX_die_offset220 .byte 0 # End of list: fa221.Lnames0:222 .byte 57 # Abbreviation code223 .long 35 # DW_IDX_die_offset224 .byte 0 # End of list: ns225.Lnames2:226 .byte 46 # Abbreviation code227 .long 37 # DW_IDX_die_offset228 .byte 0 # End of list: _ZN2ns2faEv229 .p2align 2, 0x0230.Lnames_end0:231 .section ".note.GNU-stack","",@progbits232 .addrsig233 .section .debug_line,"",@progbits234.Lline_table_start0:235