Skip to content

Commit 8c807df

Browse files
committed
Updates to tests
1 parent 3b8935a commit 8c807df

File tree

2 files changed

+136
-1
lines changed

2 files changed

+136
-1
lines changed
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
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-input-lowpc-ranges-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-input-lowpc-ranges-other.s \
7+
; RUN: -split-dwarf-file=mainOther.dwo -o other.o
8+
; RUN: %clang %cflags main.o other.o -o main.exe
9+
; RUN: llvm-bolt main.exe -o main.exe.bolt --update-debug-sections --cu-processing-batch-size=1
10+
; RUN: llvm-bolt main.exe -o main-batch.exe.bolt --update-debug-sections --cu-processing-batch-size=2
11+
; RUN: llvm-dwarfdump --show-form --verbose --debug-rnglists main.exe.bolt &> %t/foo.txt
12+
; RUN: llvm-dwarfdump --show-form --verbose --debug-addr main.exe.bolt >> %t/foo.txt
13+
; RUN: llvm-dwarfdump --show-form --verbose --debug-info main.exe.bolt >> %t/foo.txt
14+
; RUN: cat %t/foo.txt | FileCheck -check-prefix=BOLT %s
15+
; RUN: llvm-dwarfdump --show-form --verbose --debug-rnglists main.exe.bolt &> %t/foo-batch.txt
16+
; RUN: llvm-dwarfdump --show-form --verbose --debug-addr main.exe.bolt >> %t/foo-batch.txt
17+
; RUN: llvm-dwarfdump --show-form --verbose --debug-info main.exe.bolt >> %t/foo-batch.txt
18+
; RUN: cat %t/foo-batch.txt | FileCheck -check-prefix=BOLT-BATCH %s
19+
; RUN: llvm-dwarfdump --show-form --verbose --debug-info main.dwo.dwo mainOther.dwo.dwo &> %t/mainddwodwo.txt
20+
; RUN: cat %t/mainddwodwo.txt | FileCheck -check-prefix=BOLT-DWO-MAIN %s
21+
22+
;; Tests that BOLT correctly handles Skeleton CU which has DW_AT_low_pc/DW_AT_ranges as input and handles multiple CUs with ranges
23+
;; and with multiple batch sizes.
24+
25+
; BOLT: Addrs: [
26+
; BOLT-NEXT: 0x[[#%.16x,ADDR1:]]
27+
; BOLT-NEXT: 0x[[#%.16x,ADDR2:]]
28+
; BOLT-NEXT: 0x[[#%.16x,ADDR3:]]
29+
; BOLT-NEXT: 0x[[#%.16x,ADDR4:]]
30+
; BOLT-NEXT: 0x[[#%.16x,ADDR5:]]
31+
32+
; BOLT: Addrs: [
33+
; BOLT-NEXT: 0x[[#%.16x,ADDR6:]]
34+
; BOLT-NEXT: 0x[[#%.16x,ADDR7:]]
35+
; BOLT-NEXT: 0x[[#%.16x,ADDR8:]]
36+
; BOLT-NEXT: 0x[[#%.16x,ADDR9:]]
37+
; BOLT-NEXT: 0x[[#%.16x,ADDR10:]]
38+
39+
; BOLT: DW_TAG_skeleton_unit
40+
; BOLT: DW_AT_dwo_name [DW_FORM_strx1] (indexed (00000001) string = "main.dwo.dwo")
41+
; BOLT-NEXT: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000)
42+
; BOLT-NEXT: DW_AT_ranges [DW_FORM_rnglistx] (indexed (0x0) rangelist = 0x00000010
43+
; BOLT-NEXT: [0x[[#ADDR1]], 0x[[#ADDR1 + 0x16]])
44+
; BOLT-NEXT: [0x[[#ADDR1 + 0x16]], 0x[[#ADDR1 + 0x24]])
45+
; BOLT-NEXT: [0x[[#ADDR1 + 0x24]], 0x[[#ADDR1 + 0x29]])
46+
; BOLT-NEXT: [0x[[#ADDR1 + 0x30]], 0x[[#ADDR1 + 0x46]])
47+
; BOLT-NEXT: [0x[[#ADDR1 + 0x50]], 0x[[#ADDR1 + 0x77]])
48+
; BOLT-NEXT: [0x[[#ADDR1 + 0x77]], 0x[[#ADDR1 + 0x85]])
49+
; BOLT-NEXT: [0x[[#ADDR1 + 0x85]], 0x[[#ADDR1 + 0x9f]])
50+
; BOLT-NEXT: DW_AT_addr_base [DW_FORM_sec_offset] (0x00000008)
51+
; BOLT-NEXT: DW_AT_rnglists_base [DW_FORM_sec_offset] (0x0000000c)
52+
53+
; BOLT: DW_TAG_skeleton_unit
54+
; BOLT: DW_AT_dwo_name [DW_FORM_strx1] (indexed (00000001) string = "mainOther.dwo.dwo")
55+
; BOLT-NEXT: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000)
56+
; BOLT-NEXT: DW_AT_ranges [DW_FORM_rnglistx] (indexed (0x0) rangelist = 0x0000003b
57+
; BOLT-NEXT: [0x[[#ADDR6]], 0x[[#ADDR6 + 0x16]])
58+
; BOLT-NEXT: [0x[[#ADDR6 + 0x16]], 0x[[#ADDR6 + 0x24]])
59+
; BOLT-NEXT: [0x[[#ADDR6 + 0x24]], 0x[[#ADDR6 + 0x29]])
60+
; BOLT-NEXT: [0x[[#ADDR6 + 0x30]], 0x[[#ADDR6 + 0x46]])
61+
; BOLT-NEXT: [0x[[#ADDR6 + 0x50]], 0x[[#ADDR6 + 0x70]])
62+
; BOLT-NEXT: [0x[[#ADDR6 + 0x70]], 0x[[#ADDR6 + 0x7e]])
63+
; BOLT-NEXT: [0x[[#ADDR6 + 0x7e]], 0x[[#ADDR6 + 0x98]])
64+
; BOLT-NEXT: DW_AT_addr_base [DW_FORM_sec_offset] (0x00000038)
65+
; BOLT-NEXT: DW_AT_rnglists_base [DW_FORM_sec_offset] (0x00000037)
66+
67+
; BOLT-BATCH: Addrs: [
68+
; BOLT-BATCH-NEXT: 0x[[#%.16x,ADDR1:]]
69+
; BOLT-BATCH-NEXT: 0x[[#%.16x,ADDR2:]]
70+
; BOLT-BATCH-NEXT: 0x[[#%.16x,ADDR3:]]
71+
; BOLT-BATCH-NEXT: 0x[[#%.16x,ADDR4:]]
72+
; BOLT-BATCH-NEXT: 0x[[#%.16x,ADDR5:]]
73+
74+
; BOLT-BATCH: Addrs: [
75+
; BOLT-BATCH-NEXT: 0x[[#%.16x,ADDR6:]]
76+
; BOLT-BATCH-NEXT: 0x[[#%.16x,ADDR7:]]
77+
; BOLT-BATCH-NEXT: 0x[[#%.16x,ADDR8:]]
78+
; BOLT-BATCH-NEXT: 0x[[#%.16x,ADDR9:]]
79+
; BOLT-BATCH-NEXT: 0x[[#%.16x,ADDR10:]]
80+
81+
; BOLT-BATCH: DW_TAG_skeleton_unit
82+
; BOLT-BATCH: DW_AT_dwo_name [DW_FORM_strx1] (indexed (00000001) string = "main.dwo.dwo")
83+
; BOLT-BATCH-NEXT: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000)
84+
; BOLT-BATCH-NEXT: DW_AT_ranges [DW_FORM_rnglistx] (indexed (0x0) rangelist = 0x00000010
85+
; BOLT-BATCH-NEXT: [0x[[#ADDR1]], 0x[[#ADDR1 + 0x16]])
86+
; BOLT-BATCH-NEXT: [0x[[#ADDR1 + 0x16]], 0x[[#ADDR1 + 0x24]])
87+
; BOLT-BATCH-NEXT: [0x[[#ADDR1 + 0x24]], 0x[[#ADDR1 + 0x29]])
88+
; BOLT-BATCH-NEXT: [0x[[#ADDR1 + 0x30]], 0x[[#ADDR1 + 0x46]])
89+
; BOLT-BATCH-NEXT: [0x[[#ADDR1 + 0x50]], 0x[[#ADDR1 + 0x77]])
90+
; BOLT-BATCH-NEXT: [0x[[#ADDR1 + 0x77]], 0x[[#ADDR1 + 0x85]])
91+
; BOLT-BATCH-NEXT: [0x[[#ADDR1 + 0x85]], 0x[[#ADDR1 + 0x9f]])
92+
; BOLT-BATCH-NEXT: DW_AT_addr_base [DW_FORM_sec_offset] (0x00000008)
93+
; BOLT-BATCH-NEXT: DW_AT_rnglists_base [DW_FORM_sec_offset] (0x0000000c)
94+
95+
; BOLT-BATCH: DW_TAG_skeleton_unit
96+
; BOLT-BATCH: DW_AT_dwo_name [DW_FORM_strx1] (indexed (00000001) string = "mainOther.dwo.dwo")
97+
; BOLT-BATCH-NEXT: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000)
98+
; BOLT-BATCH-NEXT: DW_AT_ranges [DW_FORM_rnglistx] (indexed (0x0) rangelist = 0x0000003b
99+
; BOLT-BATCH-NEXT: [0x[[#ADDR6]], 0x[[#ADDR6 + 0x16]])
100+
; BOLT-BATCH-NEXT: [0x[[#ADDR6 + 0x16]], 0x[[#ADDR6 + 0x24]])
101+
; BOLT-BATCH-NEXT: [0x[[#ADDR6 + 0x24]], 0x[[#ADDR6 + 0x29]])
102+
; BOLT-BATCH-NEXT: [0x[[#ADDR6 + 0x30]], 0x[[#ADDR6 + 0x46]])
103+
; BOLT-BATCH-NEXT: [0x[[#ADDR6 + 0x50]], 0x[[#ADDR6 + 0x70]])
104+
; BOLT-BATCH-NEXT: [0x[[#ADDR6 + 0x70]], 0x[[#ADDR6 + 0x7e]])
105+
; BOLT-BATCH-NEXT: [0x[[#ADDR6 + 0x7e]], 0x[[#ADDR6 + 0x98]])
106+
; BOLT-BATCH-NEXT: DW_AT_addr_base [DW_FORM_sec_offset] (0x00000038)
107+
; BOLT-BATCH-NEXT: DW_AT_rnglists_base [DW_FORM_sec_offset] (0x00000037)
108+
109+
; BOLT-DWO-MAIN: DW_TAG_subprogram
110+
; BOLT-DWO-MAIN-NEXT: DW_AT_ranges [DW_FORM_rnglistx] (indexed (0x0) rangelist = 0x00000014
111+
; BOLT-DWO-MAIN-NEXT: [0x0000000000000000, 0x0000000000000016)
112+
; BOLT-DWO-MAIN-NEXT: [0x0000000000000016, 0x0000000000000024)
113+
; BOLT-DWO-MAIN-NEXT: [0x0000000000000024, 0x0000000000000029))
114+
; BOLT-DWO-MAIN: DW_TAG_subprogram
115+
; BOLT-DWO-MAIN: DW_TAG_subprogram
116+
; BOLT-DWO-MAIN: DW_TAG_subprogram
117+
; BOLT-DWO-MAIN: DW_TAG_subprogram
118+
; BOLT-DWO-MAIN-NEXT: DW_AT_ranges [DW_FORM_rnglistx] (indexed (0x1) rangelist = 0x00000020
119+
; BOLT-DWO-MAIN-NEXT: [0x0000000000000002, 0x0000000000000029)
120+
; BOLT-DWO-MAIN-NEXT: [0x0000000000000029, 0x0000000000000037)
121+
; BOLT-DWO-MAIN-NEXT: [0x0000000000000037, 0x0000000000000051))
122+
123+
; BOLT-DWO-MAIN: DW_TAG_subprogram
124+
; BOLT-DWO-MAIN-NEXT: DW_AT_ranges [DW_FORM_rnglistx] (indexed (0x0) rangelist = 0x00000014
125+
; BOLT-DWO-MAIN-NEXT: [0x0000000000000000, 0x0000000000000016)
126+
; BOLT-DWO-MAIN-NEXT: [0x0000000000000016, 0x0000000000000024)
127+
; BOLT-DWO-MAIN-NEXT: [0x0000000000000024, 0x0000000000000029))
128+
; BOLT-DWO-MAIN: DW_TAG_subprogram
129+
; BOLT-DWO-MAIN: DW_TAG_subprogram
130+
; BOLT-DWO-MAIN: DW_TAG_subprogram
131+
; BOLT-DWO-MAIN: DW_TAG_subprogram
132+
; BOLT-DWO-MAIN-NEXT: DW_AT_ranges [DW_FORM_rnglistx] (indexed (0x1) rangelist = 0x00000020
133+
; BOLT-DWO-MAIN-NEXT: [0x0000000000000002, 0x0000000000000022)
134+
; BOLT-DWO-MAIN-NEXT: [0x0000000000000022, 0x0000000000000030)
135+
; BOLT-DWO-MAIN-NEXT: [0x0000000000000030, 0x000000000000004a))

bolt/test/X86/dwarf5-df-input-lowpc-ranges-cus.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
; RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf5-df-input-lowpc-ranges-other.s \
77
; RUN: -split-dwarf-file=mainOther.dwo -o other.o
88
; RUN: %clang %cflags main.o other.o -o main.exe
9-
; RUN: llvm-bolt main.exe -o main.exe.bolt --update-debug-sections --cu-processing-batch-size=2
9+
; RUN: llvm-bolt main.exe -o main.exe.bolt --update-debug-sections
1010
; RUN: llvm-dwarfdump --show-form --verbose --debug-rnglists main.exe.bolt &> %t/foo.txt
1111
; RUN: llvm-dwarfdump --show-form --verbose --debug-addr main.exe.bolt >> %t/foo.txt
1212
; RUN: llvm-dwarfdump --show-form --verbose --debug-info main.exe.bolt >> %t/foo.txt

0 commit comments

Comments
 (0)