xref: /llvm-project/llvm/test/tools/llvm-dwarfdump/X86/debug-names-verify-completeness.s (revision 01bb3b07c346c4215a83893d15f3c6022773ef83)
1# RUN: llvm-mc -triple x86_64-pc-linux %s -filetype=obj -o - | not llvm-dwarfdump -verify - | FileCheck %s
2
3# CHECK: error: Name Index @ 0x0: Entry for DIE @ {{.*}} (DW_TAG_namespace) with name namesp missing.
4# CHECK: error: Name Index @ 0x0: Entry for DIE @ {{.*}} (DW_TAG_variable) with name var_block_addr missing.
5# CHECK: error: Name Index @ 0x0: Entry for DIE @ {{.*}} (DW_TAG_namespace) with name (anonymous namespace) missing.
6# CHECK: error: Name Index @ 0x0: Entry for DIE @ {{.*}} (DW_TAG_variable) with name var_loc_addr missing.
7# CHECK: error: Name Index @ 0x0: Entry for DIE @ {{.*}} (DW_TAG_variable) with name var_loc_tls missing.
8# CHECK: error: Name Index @ 0x0: Entry for DIE @ {{.*}} (DW_TAG_variable) with name var_loc_gnu_tls missing.
9# CHECK: error: Name Index @ 0x0: Entry for DIE @ {{.*}} (DW_TAG_subprogram) with name fun_name missing.
10# CHECK: error: Name Index @ 0x0: Entry for DIE @ {{.*}} (DW_TAG_subprogram) with name _Z8fun_name missing.
11# CHECK: error: Name Index @ 0x0: Entry for DIE @ {{.*}} (DW_TAG_inlined_subroutine) with name fun_inline missing.
12# CHECK: error: Name Index @ 0x0: Entry for DIE @ {{.*}} (DW_TAG_label) with name label missing.
13
14        .section        .debug_loc,"",@progbits
15.Ldebug_loc0:
16        .quad   0
17        .quad   1
18        .short  .Lloc0_end-.Lloc0_start # Loc expr size
19.Lloc0_start:
20        .byte   3                       # DW_OP_addr
21        .quad 0x47
22.Lloc0_end:
23        .quad   0
24        .quad   0
25
26        .section        .debug_abbrev,"",@progbits
27        .byte   1                       # Abbreviation Code
28        .byte   17                      # DW_TAG_compile_unit
29        .byte   1                       # DW_CHILDREN_yes
30        .byte   37                      # DW_AT_producer
31        .byte   8                       # DW_FORM_string
32        .byte   17                      # DW_AT_low_pc
33        .byte   1                       # DW_FORM_addr
34        .byte   18                      # DW_AT_high_pc
35        .byte   6                       # DW_FORM_data4
36        .byte   0                       # EOM(1)
37        .byte   0                       # EOM(2)
38
39        .byte   2                       # Abbreviation Code
40        .byte   52                      # DW_TAG_variable
41        .byte   0                       # DW_CHILDREN_no
42        .byte   3                       # DW_AT_name
43        .byte   8                       # DW_FORM_string
44        .byte   2                       # DW_AT_location
45        .byte   24                      # DW_FORM_exprloc
46        .byte   0                       # EOM(1)
47        .byte   0                       # EOM(2)
48
49        .byte   3                       # Abbreviation Code
50        .byte   46                      # DW_TAG_subprogram
51        .byte   1                       # DW_CHILDREN_yes
52        .byte   3                       # DW_AT_name
53        .byte   8                       # DW_FORM_string
54        .byte   110                     # DW_AT_linkage_name
55        .byte   8                       # DW_FORM_string
56        .byte   82                      # DW_AT_entry_pc
57        .byte   1                       # DW_FORM_addr
58        .byte   0                       # EOM(1)
59        .byte   0                       # EOM(2)
60
61        .byte   4                       # Abbreviation Code
62        .byte   57                      # DW_TAG_namespace
63        .byte   1                       # DW_CHILDREN_yes
64        .byte   3                       # DW_AT_name
65        .byte   8                       # DW_FORM_string
66        .byte   0                       # EOM(1)
67        .byte   0                       # EOM(2)
68
69        .byte   5                       # Abbreviation Code
70        .byte   52                      # DW_TAG_variable
71        .byte   0                       # DW_CHILDREN_no
72        .byte   3                       # DW_AT_name
73        .byte   8                       # DW_FORM_string
74        .byte   2                       # DW_AT_location
75        .byte   23                      # DW_FORM_sec_offset
76        .byte   0                       # EOM(1)
77        .byte   0                       # EOM(2)
78
79        .byte   6                       # Abbreviation Code
80        .byte   57                      # DW_TAG_namespace
81        .byte   1                       # DW_CHILDREN_yes
82        .byte   0                       # EOM(1)
83        .byte   0                       # EOM(2)
84
85        .byte   7                       # Abbreviation Code
86        .byte   29                      # DW_TAG_inlined_subroutine
87        .byte   0                       # DW_CHILDREN_no
88        .byte   3                       # DW_AT_name
89        .byte   8                       # DW_FORM_string
90        .byte   17                      # DW_AT_low_pc
91        .byte   1                       # DW_FORM_addr
92        .byte   18                      # DW_AT_high_pc
93        .byte   1                       # DW_FORM_addr
94        .byte   0                       # EOM(1)
95        .byte   0                       # EOM(2)
96
97        .byte   8                       # Abbreviation Code
98        .byte   10                      # DW_TAG_label
99        .byte   0                       # DW_CHILDREN_no
100        .byte   3                       # DW_AT_name
101        .byte   8                       # DW_FORM_string
102        .byte   82                      # DW_AT_entry_pc
103        .byte   1                       # DW_FORM_addr
104        .byte   0                       # EOM(1)
105        .byte   0                       # EOM(2)
106
107        .byte   0                       # EOM(3)
108        .section        .debug_info,"",@progbits
109
110.Lcu_begin0:
111        .long   .Lcu_end0-.Lcu_start0   # Length of Unit
112.Lcu_start0:
113        .short  4                       # DWARF version number
114        .long   .debug_abbrev           # Offset Into Abbrev. Section
115        .byte   8                       # Address Size (in bytes)
116        .byte   1                       # Abbrev [1] DW_TAG_compile_unit
117        .asciz  "hand-written DWARF"    # DW_AT_producer
118        .quad   0x0                     # DW_AT_low_pc
119        .long   0x100                   # DW_AT_high_pc
120
121        .byte   4                       # Abbrev [4] DW_TAG_namespace
122        .asciz  "namesp"                # DW_AT_name
123        .byte   2                       # Abbrev [2] DW_TAG_variable
124        .asciz  "var_block_addr"        # DW_AT_name
125        .byte   9                       # DW_AT_location
126        .byte   3                       # DW_OP_addr
127        .quad   0x47
128        .byte   0                       # End Of Children Mark
129
130        .byte   6                       # Abbrev [6] DW_TAG_namespace
131        .byte   5                       # Abbrev [5] DW_TAG_variable
132        .asciz  "var_loc_addr"          # DW_AT_name
133        .long   .Ldebug_loc0            # DW_AT_location
134        .byte   0                       # End Of Children Mark
135
136        .byte   2                       # Abbrev [2] DW_TAG_variable
137        .asciz  "var_loc_tls"           # DW_AT_name
138        .byte   1                       # DW_AT_location
139        .byte   0x9b                    # DW_OP_form_tls_address
140
141        .byte   2                       # Abbrev [2] DW_TAG_variable
142        .asciz  "var_loc_gnu_tls"       # DW_AT_name
143        .byte   1                       # DW_AT_location
144        .byte   0xe0                    # DW_OP_GNU_push_tls_address
145
146        .byte   3                       # Abbrev [3] DW_TAG_subprogram
147        .asciz  "fun_name"              # DW_AT_name
148        .asciz  "_Z8fun_name"           # DW_AT_linkage_name
149        .quad   0x47                    # DW_AT_entry_pc
150        .byte   7                       # Abbrev [7] DW_TAG_inlined_subroutine
151        .asciz  "fun_inline"            # DW_AT_name
152        .quad   0x48                    # DW_AT_low_pc
153        .quad   0x49                    # DW_AT_high_pc
154        .byte   8                       # Abbrev [8] DW_TAG_label
155        .asciz  "label"                 # DW_AT_name
156        .quad   0x4a                    # DW_AT_entry_pc
157        .byte   0                       # End Of Children Mark
158
159        .byte   0                       # End Of Children Mark
160.Lcu_end0:
161
162        .section        .debug_names,"",@progbits
163        .long   .Lnames_end0-.Lnames_start0 # Header: contribution length
164.Lnames_start0:
165        .short  5                       # Header: version
166        .short  0                       # Header: padding
167        .long   1                       # Header: compilation unit count
168        .long   0                       # Header: local type unit count
169        .long   0                       # Header: foreign type unit count
170        .long   0                       # Header: bucket count
171        .long   0                       # Header: name count
172        .long   .Lnames_abbrev_end0-.Lnames_abbrev_start0 # Header: abbreviation table size
173        .long   0                       # Header: augmentation length
174        .long   .Lcu_begin0             # Compilation unit 0
175.Lnames_abbrev_start0:
176        .byte   0                       # End of abbrev list
177.Lnames_abbrev_end0:
178.Lnames_entries0:
179.Lnames_end0:
180
181