xref: /llvm-project/bolt/test/X86/dwarf5-df-main-debug-names-ftu-ltu-mix.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-ftu-ltu-mix-main.s \
5; RUN: -split-dwarf-file=main.dwo -o main.o
6; RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf5-debug-names-ftu-ltu-mix-helper.s -o helper.o
7; RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf5-debug-names-ftu-ltu-mix-helper1.s -o helper1.o
8; RUN: %clang %cflags -gdwarf-5 -gsplit-dwarf=split main.o helper.o helper1.o -o main.exe -fno-pic -no-pie
9; RUN: llvm-bolt main.exe -o main.exe.bolt --update-debug-sections --create-debug-names-section=true
10; RUN: llvm-dwarfdump --debug-names main.exe.bolt | FileCheck -check-prefix=BOLT %s
11
12;; Tests BOLT correctly sets foreign TU Index when there are local TUs.
13
14; BOLT:        Compilation Unit offsets [
15; BOLT-NEXT:     CU[0]: {{.+}}
16; BOLT-NEXT:     CU[1]: {{.+}}
17; BOLT-NEXT:     CU[2]: {{.+}}
18; BOLT-NEXT:   ]
19; BOLT-NEXT:   Local Type Unit offsets [
20; BOLT-NEXT:     LocalTU[0]: {{.+}}
21; BOLT-NEXT:     LocalTU[1]: {{.+}}
22; BOLT-NEXT:   ]
23; BOLT-NEXT:   Foreign Type Unit signatures [
24; BOLT-NEXT:     ForeignTU[0]: 0x889c84450dac881f
25; BOLT-NEXT:   ]
26; BOLT:        Name 3 {
27; BOLT-NEXT:     Hash: 0x6A05C500
28; BOLT-NEXT:     String: {{.+}} "globalMono1"
29; BOLT-NEXT:     Entry @ {{.+}} {
30; BOLT-NEXT:       Abbrev: 0x5
31; BOLT-NEXT:       Tag: DW_TAG_variable
32; BOLT-NEXT:       DW_IDX_compile_unit: 0x02
33; BOLT-NEXT:       DW_IDX_die_offset: 0x0000001e
34; BOLT-NEXT:       DW_IDX_parent: <parent not indexed>
35; BOLT-NEXT:     }
36; BOLT-NEXT:   }
37; BOLT:        Name 6 {
38; BOLT-NEXT:     Hash: 0xF283AF92
39; BOLT-NEXT:     String: {{.+}} "ASplit"
40; BOLT-NEXT:     Entry @ {{.+}} {
41; BOLT-NEXT:       Abbrev: 0x7
42; BOLT-NEXT:       Tag: DW_TAG_structure_type
43; BOLT-NEXT:       DW_IDX_type_unit: 0x02
44; BOLT-NEXT:       DW_IDX_compile_unit: 0x00
45; BOLT-NEXT:       DW_IDX_die_offset: 0x00000021
46; BOLT-NEXT:       DW_IDX_parent: <parent not indexed>
47; BOLT-NEXT:     }
48; BOLT-NEXT:   }
49; BOLT:        Name 7 {
50; BOLT-NEXT:     Hash: 0xF17F51F
51; BOLT-NEXT:     String: {{.+}} "AMono"
52; BOLT-NEXT:     Entry @ {{.+}} {
53; BOLT-NEXT:       Abbrev: 0x4
54; BOLT-NEXT:       Tag: DW_TAG_structure_type
55; BOLT-NEXT:       DW_IDX_type_unit: 0x00
56; BOLT-NEXT:       DW_IDX_die_offset: 0x00000023
57; BOLT-NEXT:       DW_IDX_parent: <parent not indexed>
58; BOLT-NEXT:     }
59; BOLT-NEXT:   }
60