xref: /llvm-project/bolt/test/X86/dwarf5-one-cu-debug-names.test (revision 4841858862df4b8ac4ac68922086f03c8bbd3dc2)
1; RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf5-debug-names-main.s   -o %tmain.o
2; RUN: %clang %cflags -gdwarf-5 %tmain.o -o %tmain.exe
3; RUN: llvm-bolt %tmain.exe -o %tmain.exe.bolt --update-debug-sections
4; RUN: llvm-dwarfdump --debug-info -r 0 --debug-names %tmain.exe.bolt > %tlog.txt
5; RUN: cat %tlog.txt | FileCheck -check-prefix=BOLT %s
6
7;; Tests that BOLT correctly generates .debug_names section with one CUs
8
9; BOLT: [[OFFSET1:0x[0-9a-f]*]]: Compile Unit
10; BOLT:       Name Index @ 0x0 {
11; BOLT-NEXT:   Header {
12; BOLT-NEXT:     Length: 0x14F
13; BOLT-NEXT:     Format: DWARF32
14; BOLT-NEXT:     Version: 5
15; BOLT-NEXT:     CU count: 1
16; BOLT-NEXT:     Local TU count: 0
17; BOLT-NEXT:     Foreign TU count: 0
18; BOLT-NEXT:     Bucket count: 11
19; BOLT-NEXT:     Name count: 11
20; BOLT-NEXT:     Abbreviations table size: 0x31
21; BOLT-NEXT:     Augmentation: 'BOLT'
22; BOLT-NEXT:   }
23; BOLT-NEXT:   Compilation Unit offsets [
24; BOLT-NEXT:     CU[0]: [[OFFSET1]]
25; BOLT-NEXT:   ]
26; BOLT-NEXT:   Abbreviations [
27; BOLT-NEXT:     Abbreviation [[ABBREV1:0x[0-9a-f]*]] {
28; BOLT-NEXT:       Tag: DW_TAG_structure_type
29; BOLT-NEXT:       DW_IDX_die_offset: DW_FORM_ref4
30; BOLT-NEXT:       DW_IDX_parent: DW_FORM_flag_present
31; BOLT-NEXT:     }
32; BOLT-NEXT:     Abbreviation [[ABBREV2:0x[0-9a-f]*]] {
33; BOLT-NEXT:       Tag: DW_TAG_base_type
34; BOLT-NEXT:       DW_IDX_die_offset: DW_FORM_ref4
35; BOLT-NEXT:       DW_IDX_parent: DW_FORM_flag_present
36; BOLT-NEXT:     }
37; BOLT-NEXT:     Abbreviation [[ABBREV3:0x[0-9a-f]*]] {
38; BOLT-NEXT:        Tag: DW_TAG_structure_type
39; BOLT-NEXT:        DW_IDX_die_offset: DW_FORM_ref4
40; BOLT-NEXT:        DW_IDX_parent: DW_FORM_ref4
41; BOLT-NEXT:     }
42; BOLT-NEXT:     Abbreviation [[ABBREV4:0x[0-9a-f]*]] {
43; BOLT-NEXT:       Tag: DW_TAG_variable
44; BOLT-NEXT:       DW_IDX_die_offset: DW_FORM_ref4
45; BOLT-NEXT:       DW_IDX_parent: DW_FORM_flag_present
46; BOLT-NEXT:     }
47; BOLT-NEXT:     Abbreviation [[ABBREV5:0x[0-9a-f]*]] {
48; BOLT-NEXT:       Tag: DW_TAG_subprogram
49; BOLT-NEXT:       DW_IDX_die_offset: DW_FORM_ref4
50; BOLT-NEXT:       DW_IDX_parent: DW_FORM_flag_present
51; BOLT-NEXT:     }
52; BOLT-NEXT:     Abbreviation [[ABBREV6:0x[0-9a-f]*]] {
53; BOLT-NEXT:       Tag: DW_TAG_namespace
54; BOLT-NEXT:       DW_IDX_die_offset: DW_FORM_ref4
55; BOLT-NEXT:       DW_IDX_parent: DW_FORM_flag_present
56; BOLT-NEXT:     }
57; BOLT-NEXT:   ]
58; BOLT-NEXT:   Bucket 0 [
59; BOLT-NEXT:     Name 1 {
60; BOLT-NEXT:       Hash: 0xF73809C
61; BOLT-NEXT:       String: {{.+}} "Foo2a"
62; BOLT-NEXT:       Entry @ {{.+}} {
63; BOLT-NEXT:         Abbrev: [[ABBREV1]]
64; BOLT-NEXT:         Tag: DW_TAG_structure_type
65; BOLT-NEXT:         DW_IDX_die_offset: 0x00000104
66; BOLT-NEXT:         DW_IDX_parent: <parent not indexed>
67; BOLT-NEXT:       }
68; BOLT-NEXT:     }
69; BOLT-NEXT:     Name 2 {
70; BOLT-NEXT:       Hash: 0x7C952063
71; BOLT-NEXT:       String: {{.+}} "char"
72; BOLT-NEXT:       Entry @ {{.+}} {
73; BOLT-NEXT:         Abbrev: [[ABBREV2]]
74; BOLT-NEXT:         Tag: DW_TAG_base_type
75; BOLT-NEXT:         DW_IDX_die_offset: 0x000000c5
76; BOLT-NEXT:         DW_IDX_parent: <parent not indexed>
77; BOLT-NEXT:       }
78; BOLT-NEXT:     }
79; BOLT-NEXT:   ]
80; BOLT-NEXT:   Bucket 1 [
81; BOLT-NEXT:     Name 3 {
82; BOLT-NEXT:       Hash: 0xB887389
83; BOLT-NEXT:       String: {{.+}} "Foo"
84; BOLT-NEXT:       Entry @ {{.+}} {
85; BOLT-NEXT:         Abbrev: [[ABBREV1]]
86; BOLT-NEXT:         Tag: DW_TAG_structure_type
87; BOLT-NEXT:         DW_IDX_die_offset: 0x000000c9
88; BOLT-NEXT:         DW_IDX_parent: <parent not indexed>
89; BOLT-NEXT:       }
90; BOLT-NEXT:     }
91; BOLT-NEXT:     Name 4 {
92; BOLT-NEXT:       Hash: 0x392140FA
93; BOLT-NEXT:       String: {{.+}} "t2<&fooint>"
94; BOLT-NEXT:       Entry @ {{.+}} {
95; BOLT-NEXT:         Abbrev: [[ABBREV1]]
96; BOLT-NEXT:         Tag: DW_TAG_structure_type
97; BOLT-NEXT:         DW_IDX_die_offset: 0x0000003f
98; BOLT-NEXT:         DW_IDX_parent: <parent not indexed>
99; BOLT-NEXT:       }
100; BOLT-NEXT:     }
101; BOLT-NEXT:   ]
102; BOLT-NEXT:   Bucket 2 [
103; BOLT-NEXT:     Name 5 {
104; BOLT-NEXT:       Hash: 0x7C96E4DB
105; BOLT-NEXT:       String: {{.+}} "Foo2"
106; BOLT-NEXT:       Entry @ {{.+}} {
107; BOLT-NEXT:         Abbrev: [[ABBREV1]]
108; BOLT-NEXT:         Tag: DW_TAG_structure_type
109; BOLT-NEXT:         DW_IDX_die_offset: 0x000000eb
110; BOLT-NEXT:         DW_IDX_parent: <parent not indexed>
111; BOLT-NEXT:       }
112; BOLT-NEXT:     }
113; BOLT-NEXT:   ]
114; BOLT-NEXT:   Bucket 3 [
115; BOLT-NEXT:     EMPTY
116; BOLT-NEXT:   ]
117; BOLT-NEXT:   Bucket 4 [
118; BOLT-NEXT:     EMPTY
119; BOLT-NEXT:   ]
120; BOLT-NEXT:   Bucket 5 [
121; BOLT-NEXT:     Name 6 {
122; BOLT-NEXT:       Hash: 0x59796A
123; BOLT-NEXT:       String: {{.+}} "t1"
124; BOLT-NEXT:       Entry @ {{.+}} {
125; BOLT-NEXT:         Abbrev: [[ABBREV3]]
126; BOLT-NEXT:         Tag: DW_TAG_structure_type
127; BOLT-NEXT:         DW_IDX_die_offset: 0x00000062
128; BOLT-NEXT:         DW_IDX_parent: Entry @ 0x14d
129; BOLT-NEXT:       }
130; BOLT-NEXT:     }
131; BOLT-NEXT:     Name 7 {
132; BOLT-NEXT:       Hash: 0x5979AC
133; BOLT-NEXT:       String: {{.+}} "v1"
134; BOLT-NEXT:       Entry @ {{.+}} {
135; BOLT-NEXT:         Abbrev: [[ABBREV4]]
136; BOLT-NEXT:         Tag: DW_TAG_variable
137; BOLT-NEXT:         DW_IDX_die_offset: 0x00000024
138; BOLT-NEXT:         DW_IDX_parent: <parent not indexed>
139; BOLT-NEXT:       }
140; BOLT-NEXT:     }
141; BOLT-NEXT:   ]
142; BOLT-NEXT:   Bucket 6 [
143; BOLT-NEXT:     Name 8 {
144; BOLT-NEXT:       Hash: 0xB888030
145; BOLT-NEXT:       String: {{.+}} "int"
146; BOLT-NEXT:       Entry @ {{.+}} {
147; BOLT-NEXT:         Abbrev: [[ABBREV2]]
148; BOLT-NEXT:         Tag: DW_TAG_base_type
149; BOLT-NEXT:         DW_IDX_die_offset: 0x0000005d
150; BOLT-NEXT:         DW_IDX_parent: <parent not indexed>
151; BOLT-NEXT:       }
152; BOLT-NEXT:     }
153; BOLT-NEXT:   ]
154; BOLT-NEXT:   Bucket 7 [
155; BOLT-NEXT:     Name 9 {
156; BOLT-NEXT:       Hash: 0x59796C
157; BOLT-NEXT:       String: {{.+}} "t3"
158; BOLT-NEXT:       Entry @ {{.+}} {
159; BOLT-NEXT:         Abbrev: [[ABBREV1]]
160; BOLT-NEXT:         Tag: DW_TAG_structure_type
161; BOLT-NEXT:         DW_IDX_die_offset: 0x0000002f
162; BOLT-NEXT:         DW_IDX_parent: <parent not indexed>
163; BOLT-NEXT:       }
164; BOLT-NEXT:     }
165; BOLT-NEXT:     Name 10 {
166; BOLT-NEXT:       Hash: 0x7C9A7F6A
167; BOLT-NEXT:       String: {{.+}} "main"
168; BOLT-NEXT:       Entry @ {{.+}} {
169; BOLT-NEXT:         Abbrev: [[ABBREV5]]
170; BOLT-NEXT:         Tag: DW_TAG_subprogram
171; BOLT-NEXT:         DW_IDX_die_offset: 0x00000073
172; BOLT-NEXT:         DW_IDX_parent: <parent not indexed>
173; BOLT-NEXT:       }
174; BOLT-NEXT:     }
175; BOLT-NEXT:   ]
176; BOLT-NEXT:   Bucket 8 [
177; BOLT-NEXT:     Name 11 {
178; BOLT-NEXT:       Hash: 0x8CFC710C
179; BOLT-NEXT:       String: {{.+}} "(anonymous namespace)"
180; BOLT-NEXT:       Entry @ 0x14d {
181; BOLT-NEXT:         Abbrev: [[ABBREV6]]
182; BOLT-NEXT:         Tag: DW_TAG_namespace
183; BOLT-NEXT:         DW_IDX_die_offset: 0x00000061
184; BOLT-NEXT:         DW_IDX_parent: <parent not indexed>
185; BOLT-NEXT:       }
186; BOLT-NEXT:     }
187; BOLT-NEXT:   ]
188; BOLT-NEXT:   Bucket 9 [
189; BOLT-NEXT:     EMPTY
190; BOLT-NEXT:   ]
191; BOLT-NEXT:   Bucket 10 [
192; BOLT-NEXT:     EMPTY
193; BOLT-NEXT:   ]
194; BOLT-NEXT: }
195