xref: /llvm-project/bolt/test/X86/dwarf5-df-one-cu-debug-names.test (revision a4610c7182d35093e9e0fde5be91659a8b9da5b8)
1; RUN: rm -rf %t
2; RUN: mkdir %t
3; RUN: cd %t
4; RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf5-df-debug-names-main.s \
5; RUN: -split-dwarf-file=main.dwo -o main.o
6; RUN: %clang %cflags -gdwarf-5 -gsplit-dwarf=split main.o -o main.exe
7; RUN: llvm-bolt main.exe -o main.exe.bolt --update-debug-sections
8; RUN: llvm-dwarfdump --debug-info --debug-names main.exe.bolt > log.txt
9; RUN: cat log.txt | FileCheck -check-prefix=BOLT %s
10
11;; Tests that BOLT correctly generates .debug_names section with one CU for split dwarf.
12
13; BOLT: [[OFFSET:0x[0-9a-f]*]]: Compile Unit
14; BOLT:       Name Index @ 0x0 {
15; BOLT-NEXT:   Header {
16; BOLT-NEXT:     Length: 0xAF
17; BOLT-NEXT:     Format: DWARF32
18; BOLT-NEXT:     Version: 5
19; BOLT-NEXT:     CU count: 1
20; BOLT-NEXT:     Local TU count: 0
21; BOLT-NEXT:     Foreign TU count: 0
22; BOLT-NEXT:     Bucket count: 5
23; BOLT-NEXT:     Name count: 5
24; BOLT-NEXT:     Abbreviations table size: 0x19
25; BOLT-NEXT:     Augmentation: 'BOLT'
26; BOLT-NEXT:   }
27; BOLT-NEXT:   Compilation Unit offsets [
28; BOLT-NEXT:     CU[0]: 0x00000000
29; BOLT-NEXT:   ]
30; BOLT-NEXT:   Abbreviations [
31; BOLT-NEXT:     Abbreviation [[ABBREV1:0x[0-9a-f]*]] {
32; BOLT-NEXT:       Tag: DW_TAG_structure_type
33; BOLT-NEXT:       DW_IDX_die_offset: DW_FORM_ref4
34; BOLT-NEXT:       DW_IDX_parent: DW_FORM_flag_present
35; BOLT-NEXT:     }
36; BOLT-NEXT:     Abbreviation [[ABBREV2:0x[0-9a-f]*]] {
37; BOLT-NEXT:       Tag: DW_TAG_subprogram
38; BOLT-NEXT:       DW_IDX_die_offset: DW_FORM_ref4
39; BOLT-NEXT:       DW_IDX_parent: DW_FORM_flag_present
40; BOLT-NEXT:     }
41; BOLT-NEXT:     Abbreviation [[ABBREV3:0x[0-9a-f]*]] {
42; BOLT-NEXT:       Tag: DW_TAG_base_type
43; BOLT-NEXT:       DW_IDX_die_offset: DW_FORM_ref4
44; BOLT-NEXT:       DW_IDX_parent: DW_FORM_flag_present
45; BOLT-NEXT:     }
46; BOLT-NEXT:   ]
47; BOLT-NEXT:   Bucket 0 [
48; BOLT-NEXT:     EMPTY
49; BOLT-NEXT:   ]
50; BOLT-NEXT:   Bucket 1 [
51; BOLT-NEXT:     Name 1 {
52; BOLT-NEXT:       Hash: 0x7C96E4DB
53; BOLT-NEXT:       String: {{.+}} "Foo2"
54; BOLT-NEXT:       Entry @ {{.+}} {
55; BOLT-NEXT:         Abbrev: [[ABBREV1]]
56; BOLT-NEXT:         Tag: DW_TAG_structure_type
57; BOLT-NEXT:         DW_IDX_die_offset: 0x00000068
58; BOLT-NEXT:         DW_IDX_parent: <parent not indexed>
59; BOLT-NEXT:       }
60; BOLT-NEXT:     }
61; BOLT-NEXT:     Name 2 {
62; BOLT-NEXT:       Hash: 0x7C9A7F6A
63; BOLT-NEXT:       String: {{.+}} "main"
64; BOLT-NEXT:       Entry @ {{.+}} {
65; BOLT-NEXT:         Abbrev: [[ABBREV2]]
66; BOLT-NEXT:         Tag: DW_TAG_subprogram
67; BOLT-NEXT:         DW_IDX_die_offset: 0x0000001a
68; BOLT-NEXT:         DW_IDX_parent: <parent not indexed>
69; BOLT-NEXT:       }
70; BOLT-NEXT:     }
71; BOLT-NEXT:   ]
72; BOLT-NEXT:   Bucket 2 [
73; BOLT-NEXT:     EMPTY
74; BOLT-NEXT:   ]
75; BOLT-NEXT:   Bucket 3 [
76; BOLT-NEXT:     Name 3 {
77; BOLT-NEXT:       Hash: 0xB888030
78; BOLT-NEXT:       String: {{.+}} "int"
79; BOLT-NEXT:       Entry @ {{.+}} {
80; BOLT-NEXT:         Abbrev: [[ABBREV3]]
81; BOLT-NEXT:         Tag: DW_TAG_base_type
82; BOLT-NEXT:         DW_IDX_die_offset: 0x00000056
83; BOLT-NEXT:         DW_IDX_parent: <parent not indexed>
84; BOLT-NEXT:       }
85; BOLT-NEXT:     }
86; BOLT-NEXT:   ]
87; BOLT-NEXT:   Bucket 4 [
88; BOLT-NEXT:     Name 4 {
89; BOLT-NEXT:       Hash: 0xF73809C
90; BOLT-NEXT:       String: {{.+}} "Foo2a"
91; BOLT-NEXT:       Entry @ {{.+}} {
92; BOLT-NEXT:         Abbrev: [[ABBREV1]]
93; BOLT-NEXT:         Tag: DW_TAG_structure_type
94; BOLT-NEXT:         DW_IDX_die_offset: 0x00000078
95; BOLT-NEXT:         DW_IDX_parent: <parent not indexed>
96; BOLT-NEXT:       }
97; BOLT-NEXT:     }
98; BOLT-NEXT:     Name 5 {
99; BOLT-NEXT:       Hash: 0x7C952063
100; BOLT-NEXT:       String: {{.+}} "char"
101; BOLT-NEXT:       Entry @ {{.+}} {
102; BOLT-NEXT:         Abbrev: [[ABBREV3]]
103; BOLT-NEXT:         Tag: DW_TAG_base_type
104; BOLT-NEXT:         DW_IDX_die_offset: 0x00000064
105; BOLT-NEXT:         DW_IDX_parent: <parent not indexed>
106; BOLT-NEXT:       }
107; BOLT-NEXT:     }
108; BOLT-NEXT:   ]
109; BOLT-NEXT: }
110