[llvm-shlib] Fix the version naming style of libLLVM for Windows (#85710)
[llvm-project.git] / bolt / test / X86 / dwarf5-df-dualcu.test
blobdeaeea03669081f670e52d529428470a3f87af23
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-dualcu-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-df-dualcu-helper.s \
7 ; RUN: -split-dwarf-file=helper.dwo -o helper.o
8 ; RUN: %clang %cflags -gdwarf-5 -gsplit-dwarf=split main.o helper.o -o main.exe -fno-pic -no-pie
9 ; RUN: llvm-bolt main.exe -o main.exe.bolt --update-debug-sections --always-convert-to-ranges
10 ; RUN: llvm-dwarfdump --show-form --verbose --debug-info main.exe | FileCheck -check-prefix=PRE-BOLT %s
11 ; RUN: llvm-dwarfdump --show-form --verbose --debug-addr main.exe.bolt &> %t/foo.txt
12 ; RUN: llvm-dwarfdump --show-form --verbose --debug-info main.exe.bolt >> %t/foo.txt
13 ; RUN: cat %t/foo.txt | FileCheck -check-prefix=BOLT %s
14 ; RUN: llvm-dwarfdump --show-form --verbose --debug-info main.dwo | FileCheck -check-prefix=PRE-BOLT-DWO-MAIN %s
15 ; RUN: llvm-dwarfdump --show-form --verbose --debug-info main.dwo.dwo | FileCheck -check-prefix=BOLT-DWO-MAIN %s
16 ; RUN: llvm-dwarfdump --show-form --verbose --debug-info helper.dwo | FileCheck -check-prefix=PRE-BOLT-DWO-HELPER %s
17 ; RUN: llvm-dwarfdump --show-form --verbose --debug-info helper.dwo.dwo | FileCheck -check-prefix=BOLT-DWO-HELPER %s
19 ; Testing dwarf5 split dwarf for two CUs. Making sure DW_AT_low_pc/DW_AT_high_pc are converted correctly in the binary and in dwo.
20 ; Checking that DW_AT_location [DW_FORM_exprloc]        (DW_OP_addrx ##) are updated correctly.
22 ; PRE-BOLT: version = 0x0005
23 ; PRE-BOLT: DW_TAG_skeleton_unit
24 ; PRE-BOLT: DW_AT_low_pc [DW_FORM_addrx]
25 ; PRE-BOLT-NEXT: DW_AT_high_pc [DW_FORM_data4]
26 ; PRE-BOLT: DW_AT_addr_base [DW_FORM_sec_offset]  (0x00000008)
28 ; BOLT: Addrs: [
29 ; BOLT-NEXT: 0x
30 ; BOLT-NEXT: 0x
31 ; BOLT-NEXT: 0x[[#%.16x,ADDR:]]
32 ; BOLT-NEXT: 0x[[#%.16x,ADDR2:]]
33 ; BOLT: Addrs: [
34 ; BOLT-NEXT: 0x
35 ; BOLT-NEXT: 0x
36 ; BOLT-NEXT: 0x[[#%.16x,ADDR3:]]
37 ; BOLT: DW_TAG_skeleton_unit
38 ; BOLT: DW_AT_dwo_name [DW_FORM_strx1]  (indexed (00000001) string = "main.dwo.dwo")
39 ; BOLT-NEXT: DW_AT_low_pc [DW_FORM_addrx]       (indexed (00000004) address = 0x0000000000000000)
40 ; BOLT-NEXT: DW_AT_ranges [DW_FORM_rnglistx] (indexed (0x0) rangelist = 0x00000010
41 ; BOLT-NEXT: [0x[[#ADDR]]
42 ; BOLT-SAME: 0x[[#ADDR + 0x24]]
43 ; BOLT-NEXT: [0x[[#ADDR2]]
44 ; BOLT-SAME: 0x[[#ADDR2 + 0x59]]
45 ; BOLT-NEXT: DW_AT_addr_base [DW_FORM_sec_offset]  (0x00000008)
46 ; BOLT-NEXT: DW_AT_rnglists_base [DW_FORM_sec_offset]  (0x0000000c)
47 ; BOLT: DW_TAG_skeleton_unit
48 ; BOLT: DW_AT_dwo_name [DW_FORM_strx1]  (indexed (00000001) string = "helper.dwo.dwo")
49 ; BOLT-NEXT: DW_AT_low_pc [DW_FORM_addrx]       (indexed (00000003) address = 0x0000000000000000)
50 ; BOLT-NEXT: DW_AT_ranges [DW_FORM_rnglistx] (indexed (0x0) rangelist = 0x0000002a
51 ; BOLT-NEXT: [0x[[#ADDR3]]
52 ; BOLT-SAME: 0x[[#ADDR3 + 0x3D]]
53 ; BOLT-NEXT: DW_AT_addr_base [DW_FORM_sec_offset]  (0x00000038)
54 ; BOLT-NEXT: DW_AT_rnglists_base [DW_FORM_sec_offset]  (0x00000026)
56 ; PRE-BOLT-DWO-MAIN: version = 0x0005
57 ; PRE-BOLT-DWO-MAIN: DW_TAG_compile_unit
58 ; PRE-BOLT-DWO-MAIN: DW_TAG_variable [2]
59 ; PRE-BOLT-DWO-MAIN-NEXT: DW_AT_name [DW_FORM_strx1]    (indexed (00000000) string = "x")
60 ; PRE-BOLT-DWO-MAIN-NEXT: DW_AT_type
61 ; PRE-BOLT-DWO-MAIN-NEXT: DW_AT_external
62 ; PRE-BOLT-DWO-MAIN-NEXT: DW_AT_decl_file
63 ; PRE-BOLT-DWO-MAIN-NEXT: DW_AT_decl_line
64 ; PRE-BOLT-DWO-MAIN-NEXT: DW_AT_location [DW_FORM_exprloc]      (DW_OP_addrx 0x0)
65 ; PRE-BOLT-DWO-MAIN: DW_TAG_variable [2]
66 ; PRE-BOLT-DWO-MAIN-NEXT: DW_AT_name [DW_FORM_strx1]    (indexed (00000002) string = "y")
67 ; PRE-BOLT-DWO-MAIN-NEXT: DW_AT_type
68 ; PRE-BOLT-DWO-MAIN-NEXT: DW_AT_external
69 ; PRE-BOLT-DWO-MAIN-NEXT: DW_AT_decl_file
70 ; PRE-BOLT-DWO-MAIN-NEXT: DW_AT_decl_line
71 ; PRE-BOLT-DWO-MAIN-NEXT: DW_AT_location [DW_FORM_exprloc]      (DW_OP_addrx 0x1)
72 ; PRE-BOLT-DWO-MAIN: DW_TAG_subprogram
73 ; PRE-BOLT-DWO-MAIN-NEXT: DW_AT_low_pc [DW_FORM_addrx]  (indexed (00000002)
74 ; PRE-BOLT-DWO-MAIN-NEXT: DW_AT_high_pc [DW_FORM_data4] (0x00000024)
75 ; PRE-BOLT-DWO-MAIN-NEXT: DW_AT_frame_base
76 ; PRE-BOLT-DWO-MAIN-NEXT: DW_AT_linkage_name [DW_FORM_strx1]    (indexed (00000003) string = "_Z3usePiS_")
77 ; PRE-BOLT-DWO-MAIN-NEXT: DW_AT_name [DW_FORM_strx1]    (indexed (00000004) string = "use")
78 ; PRE-BOLT-DWO-MAIN: DW_TAG_subprogram
79 ; PRE-BOLT-DWO-MAIN-NEXT: DW_AT_low_pc [DW_FORM_addrx]  (indexed (00000003)
80 ; PRE-BOLT-DWO-MAIN-NEXT: DW_AT_high_pc [DW_FORM_data4] (0x0000005f)
81 ; PRE-BOLT-DWO-MAIN-NEXT: DW_AT_frame_base
82 ; PRE-BOLT-DWO-MAIN-NEXT: DW_AT_name [DW_FORM_strx1]    (indexed (00000005) string = "main")
84 ; BOLT-DWO-MAIN: DW_TAG_compile_unit
85 ; BOLT-DWO-MAIN: DW_TAG_variable [2]
86 ; BOLT-DWO-MAIN-NEXT: DW_AT_name [DW_FORM_strx1]        (indexed (00000000) string = "x")
87 ; BOLT-DWO-MAIN-NEXT: DW_AT_type
88 ; BOLT-DWO-MAIN-NEXT: DW_AT_external
89 ; BOLT-DWO-MAIN-NEXT: DW_AT_decl_file
90 ; BOLT-DWO-MAIN-NEXT: DW_AT_decl_line
91 ; BOLT-DWO-MAIN-NEXT: DW_AT_location [DW_FORM_exprloc]  (DW_OP_addrx 0x0)
92 ; BOLT-DWO-MAIN: DW_TAG_variable [2]
93 ; BOLT-DWO-MAIN-NEXT: DW_AT_name [DW_FORM_strx1]        (indexed (00000002) string = "y")
94 ; BOLT-DWO-MAIN-NEXT: DW_AT_type
95 ; BOLT-DWO-MAIN-NEXT: DW_AT_external
96 ; BOLT-DWO-MAIN-NEXT: DW_AT_decl_file
97 ; BOLT-DWO-MAIN-NEXT: DW_AT_decl_line
98 ; BOLT-DWO-MAIN-NEXT: DW_AT_location [DW_FORM_exprloc]  (DW_OP_addrx 0x1)
99 ; BOLT-DWO-MAIN: DW_TAG_subprogram [4]
100 ; BOLT-DWO-MAIN-NEXT: DW_AT_ranges [DW_FORM_rnglistx]   (indexed (0x0) rangelist = 0x00000014
101 ; BOLT-DWO-MAIN-NEXT: [0x0000000000000000, 0x0000000000000024))
102 ; BOLT-DWO-MAIN-NEXT: DW_AT_frame_base
103 ; BOLT-DWO-MAIN-NEXT: DW_AT_linkage_name [DW_FORM_strx1]        (indexed (00000003) string = "_Z3usePiS_")
104 ; BOLT-DWO-MAIN-NEXT: DW_AT_name [DW_FORM_strx1]        (indexed (00000004) string = "use")
105 ; BOLT-DWO-MAIN: DW_TAG_subprogram [6]
106 ; BOLT-DWO-MAIN-NEXT: DW_AT_ranges [DW_FORM_rnglistx]   (indexed (0x1) rangelist = 0x00000018
107 ; BOLT-DWO-MAIN-NEXT: [0x0000000000000000, 0x0000000000000059))
108 ; BOLT-DWO-MAIN-NEXT: DW_AT_frame_base [DW_FORM_exprloc]        (DW_OP_reg6 RBP)
109 ; BOLT-DWO-MAIN-NEXT: DW_AT_name [DW_FORM_strx1]        (indexed (00000005) string = "main")
111 ; PRE-BOLT-DWO-HELPER: version = 0x0005
112 ; PRE-BOLT-DWO-HELPER: DW_TAG_variable [2]
113 ; PRE-BOLT-DWO-HELPER-NEXT: DW_AT_name [DW_FORM_strx1]  (indexed (00000000) string = "z")
114 ; PRE-BOLT-DWO-HELPER-NEXT: DW_AT_type
115 ; PRE-BOLT-DWO-HELPER-NEXT: DW_AT_external
116 ; PRE-BOLT-DWO-HELPER-NEXT: DW_AT_decl_file
117 ; PRE-BOLT-DWO-HELPER-NEXT: DW_AT_decl_line
118 ; PRE-BOLT-DWO-HELPER-NEXT: DW_AT_location [DW_FORM_exprloc]    (DW_OP_addrx 0x0)
119 ; PRE-BOLT-DWO-HELPER: DW_TAG_variable [2]
120 ; PRE-BOLT-DWO-HELPER-NEXT: DW_AT_name [DW_FORM_strx1]  (indexed (00000002) string = "d")
121 ; PRE-BOLT-DWO-HELPER-NEXT: DW_AT_type
122 ; PRE-BOLT-DWO-HELPER-NEXT: DW_AT_external
123 ; PRE-BOLT-DWO-HELPER-NEXT: DW_AT_decl_file
124 ; PRE-BOLT-DWO-HELPER-NEXT: DW_AT_decl_line
125 ; PRE-BOLT-DWO-HELPER-NEXT: DW_AT_location [DW_FORM_exprloc]    (DW_OP_addrx 0x1)
126 ; PRE-BOLT-DWO-HELPER: DW_TAG_subprogram [4]
127 ; PRE-BOLT-DWO-HELPER-NEXT: DW_AT_low_pc [DW_FORM_addrx]        (indexed (00000002)
128 ; PRE-BOLT-DWO-HELPER-NEXT: DW_AT_high_pc [DW_FORM_data4]       (0x0000003d)
130 ; BOLT-DWO-HELPER: version = 0x0005
131 ; BOLT-DWO-HELPER: DW_TAG_variable [2]
132 ; BOLT-DWO-HELPER-NEXT: DW_AT_name [DW_FORM_strx1]      (indexed (00000000) string = "z")
133 ; BOLT-DWO-HELPER-NEXT: DW_AT_type
134 ; BOLT-DWO-HELPER-NEXT: DW_AT_external
135 ; BOLT-DWO-HELPER-NEXT: DW_AT_decl_file
136 ; BOLT-DWO-HELPER-NEXT: DW_AT_decl_line
137 ; BOLT-DWO-HELPER-NEXT: DW_AT_location [DW_FORM_exprloc]        (DW_OP_addrx 0x0)
138 ; BOLT-DWO-HELPER: DW_TAG_variable [2]
139 ; BOLT-DWO-HELPER-NEXT: DW_AT_name [DW_FORM_strx1]      (indexed (00000002) string = "d")
140 ; BOLT-DWO-HELPER-NEXT: DW_AT_type
141 ; BOLT-DWO-HELPER-NEXT: DW_AT_external
142 ; BOLT-DWO-HELPER-NEXT: DW_AT_decl_file
143 ; BOLT-DWO-HELPER-NEXT: DW_AT_decl_line
144 ; BOLT-DWO-HELPER-NEXT: DW_AT_location [DW_FORM_exprloc]        (DW_OP_addrx 0x1)
145 ; BOLT-DWO-HELPER: DW_TAG_subprogram [4]
146 ; BOLT-DWO-HELPER-NEXT: DW_AT_ranges [DW_FORM_rnglistx] (indexed (0x0) rangelist = 0x00000010
147 ; BOLT-DWO-HELPER-NEXT: [0x0000000000000000, 0x000000000000003d))