2 ## Test clang-17-generated DW_TAG_subprogram, which do not contain DW_IDX_parent
5 # RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
6 # RUN: ld.lld --debug-names %t.o -o %t
7 # RUN: llvm-dwarfdump --debug-info --debug-names %t | FileCheck %s --check-prefix=DWARF
9 # DWARF: 0x00000023: DW_TAG_namespace
10 # DWARF: 0x00000025: DW_TAG_subprogram
12 # DWARF: String: {{.*}} "fa"
13 # DWARF-NEXT: Entry @ 0x71 {
14 # DWARF-NEXT: Abbrev: 0x1
15 # DWARF-NEXT: Tag: DW_TAG_subprogram
16 # DWARF-NEXT: DW_IDX_die_offset: 0x00000025
17 # DWARF-NEXT: DW_IDX_compile_unit: 0x00
19 # DWARF: String: {{.*}} "ns"
20 # DWARF-NEXT: Entry @ 0x78 {
21 # DWARF-NEXT: Abbrev: 0x2
22 # DWARF-NEXT: Tag: DW_TAG_namespace
23 # DWARF-NEXT: DW_IDX_die_offset: 0x00000023
24 # DWARF-NEXT: DW_IDX_compile_unit: 0x00
33 clang-
17 --target
=x86_64-linux
-S
-O1
-g
-gpubnames
a.cc
-o
-
37 .globl _ZN2ns2faEv # -- Begin function _ZN2ns2faEv
39 .type _ZN2ns2faEv,@function
40 _ZN2ns2faEv
: # @_ZN2ns2faEv
42 .file 0 "/proc/self/cwd" "a.cc" md5 0xb3281d5b5a0b2997d7d59d49bc912274
45 .loc 0 2 12 prologue_end # a.cc:2:12
49 .size _ZN2ns2faEv, .Lfunc_end0-_ZN2ns2faEv
52 .section .debug_abbrev,"",@progbits
53 .byte 1 # Abbreviation Code
54 .byte 17 # DW_TAG_compile_unit
55 .byte 1 # DW_CHILDREN_yes
56 .byte 37 # DW_AT_producer
57 .byte 37 # DW_FORM_strx1
58 .byte 19 # DW_AT_language
59 .byte 5 # DW_FORM_data2
61 .byte 37 # DW_FORM_strx1
62 .byte 114 # DW_AT_str_offsets_base
63 .byte 23 # DW_FORM_sec_offset
64 .byte 16 # DW_AT_stmt_list
65 .byte 23 # DW_FORM_sec_offset
66 .byte 27 # DW_AT_comp_dir
67 .byte 37 # DW_FORM_strx1
68 .byte 17 # DW_AT_low_pc
69 .byte 27 # DW_FORM_addrx
70 .byte 18 # DW_AT_high_pc
71 .byte 6 # DW_FORM_data4
72 .byte 115 # DW_AT_addr_base
73 .byte 23 # DW_FORM_sec_offset
76 .byte 2 # Abbreviation Code
77 .byte 57 # DW_TAG_namespace
78 .byte 1 # DW_CHILDREN_yes
80 .byte 37 # DW_FORM_strx1
83 .byte 3 # Abbreviation Code
84 .byte 46 # DW_TAG_subprogram
85 .byte 0 # DW_CHILDREN_no
86 .byte 17 # DW_AT_low_pc
87 .byte 27 # DW_FORM_addrx
88 .byte 18 # DW_AT_high_pc
89 .byte 6 # DW_FORM_data4
90 .byte 64 # DW_AT_frame_base
91 .byte 24 # DW_FORM_exprloc
92 .byte 122 # DW_AT_call_all_calls
93 .byte 25 # DW_FORM_flag_present
94 .byte 110 # DW_AT_linkage_name
95 .byte 37 # DW_FORM_strx1
97 .byte 37 # DW_FORM_strx1
98 .byte 58 # DW_AT_decl_file
99 .byte 11 # DW_FORM_data1
100 .byte 59 # DW_AT_decl_line
101 .byte 11 # DW_FORM_data1
102 .byte 63 # DW_AT_external
103 .byte 25 # DW_FORM_flag_present
107 .section .debug_info,"",@progbits
109 .long .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit
111 .short 5 # DWARF version number
112 .byte 1 # DWARF Unit Type
113 .byte 8 # Address Size (in bytes)
114 .long .debug_abbrev # Offset Into Abbrev. Section
115 .byte 1 # Abbrev [1] 0xc:0x27 DW_TAG_compile_unit
116 .byte 0 # DW_AT_producer
117 .short 33 # DW_AT_language
119 .long .Lstr_offsets_base0 # DW_AT_str_offsets_base
120 .long .Lline_table_start0 # DW_AT_stmt_list
121 .byte 2 # DW_AT_comp_dir
122 .byte 0 # DW_AT_low_pc
123 .long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc
124 .long .Laddr_table_base0 # DW_AT_addr_base
125 .byte 2 # Abbrev [2] 0x23:0xf DW_TAG_namespace
127 .byte 3 # Abbrev [3] 0x25:0xc DW_TAG_subprogram
128 .byte 0 # DW_AT_low_pc
129 .long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc
130 .byte 1 # DW_AT_frame_base
132 # DW_AT_call_all_calls
133 .byte 4 # DW_AT_linkage_name
135 .byte 0 # DW_AT_decl_file
136 .byte 2 # DW_AT_decl_line
138 .byte 0 # End Of Children Mark
139 .byte 0 # End Of Children Mark
141 .section .debug_str_offsets,"",@progbits
142 .long 28 # Length of String Offsets Set
146 .section .debug_str,"MS",@progbits,1
148 .byte 0 # string offset=0
150 .asciz "a.cc" # string offset=1
152 .asciz "/proc/self/cwd" # string offset=6
154 .asciz "ns" # string offset=21
156 .asciz "fa" # string offset=24
158 .asciz "_ZN2ns2faEv" # string offset=27
159 .section .debug_str_offsets,"",@progbits
166 .section .debug_addr,"",@progbits
167 .long .Ldebug_addr_end0-.Ldebug_addr_start0 # Length of contribution
169 .short 5 # DWARF version number
170 .byte 8 # Address size
171 .byte 0 # Segment selector size
175 .section .debug_names,"",@progbits
176 .long .Lnames_end0-.Lnames_start0 # Header: unit length
178 .short 5 # Header: version
179 .short 0 # Header: padding
180 .long 1 # Header: compilation unit count
181 .long 0 # Header: local type unit count
182 .long 0 # Header: foreign type unit count
183 .long 3 # Header: bucket count
184 .long 3 # Header: name count
185 .long .Lnames_abbrev_end0-.Lnames_abbrev_start0 # Header: abbreviation table size
186 .long 8 # Header: augmentation string size
187 .ascii "LLVM0700" # Header: augmentation string
188 .long .Lcu_begin0 # Compilation unit 0
192 .long 5863372 # Hash in Bucket 1
193 .long 5863654 # Hash in Bucket 1
194 .long -1413999533 # Hash in Bucket 2
195 .long .Linfo_string4 # String in Bucket 1: fa
196 .long .Linfo_string3 # String in Bucket 1: ns
197 .long .Linfo_string5 # String in Bucket 2: _ZN2ns2faEv
198 .long .Lnames1-.Lnames_entries0 # Offset in Bucket 1
199 .long .Lnames0-.Lnames_entries0 # Offset in Bucket 1
200 .long .Lnames2-.Lnames_entries0 # Offset in Bucket 2
201 .Lnames_abbrev_start0:
202 .byte 46 # Abbrev code
203 .byte 46 # DW_TAG_subprogram
204 .byte 3 # DW_IDX_die_offset
205 .byte 19 # DW_FORM_ref4
206 .byte 0 # End of abbrev
207 .byte 0 # End of abbrev
208 .byte 57 # Abbrev code
209 .byte 57 # DW_TAG_namespace
210 .byte 3 # DW_IDX_die_offset
211 .byte 19 # DW_FORM_ref4
212 .byte 0 # End of abbrev
213 .byte 0 # End of abbrev
214 .byte 0 # End of abbrev list
218 .byte 46 # Abbreviation code
219 .long 37 # DW_IDX_die_offset
220 .byte 0 # End of list: fa
222 .byte 57 # Abbreviation code
223 .long 35 # DW_IDX_die_offset
224 .byte 0 # End of list: ns
226 .byte 46 # Abbreviation code
227 .long 37 # DW_IDX_die_offset
228 .byte 0 # End of list: _ZN2ns2faEv
231 .section ".note.GNU-stack","",@progbits
233 .section .debug_line,"",@progbits