Skip to content

Commit 7f3e473

Browse files
Add -mtriple=x86_64-unknown-linux-gnu for test
1 parent 28defd8 commit 7f3e473

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed

llvm/test/CodeGen/X86/jump-table-partition.ll

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,34 @@
33

44
; Stop after 'finalize-isel' for simpler MIR, and lower the minimum number of
55
; jump table entries so 'switch' needs fewer cases to generate a jump table.
6-
; RUN: llc -stop-after=finalize-isel -min-jump-table-entries=2 %s -o %t.mir
7-
; RUN: llc --run-pass=static-data-splitter -stats -x mir %t.mir -o - 2>&1 | FileCheck %s --check-prefix=STAT
6+
; RUN: llc -mtriple=x86_64-unknown-linux-gnu -stop-after=finalize-isel -min-jump-table-entries=2 %s -o %t.mir
7+
; RUN: llc -mtriple=x86_64-unknown-linux-gnu --run-pass=static-data-splitter -stats -x mir %t.mir -o - 2>&1 | FileCheck %s --check-prefix=STAT
8+
9+
; Tests stat messages are expected.
10+
; STAT-DAG: 2 static-data-splitter - Number of cold jump tables seen
11+
; STAT-DAG: 2 static-data-splitter - Number of hot jump tables seen
12+
; STAT-DAG: 1 static-data-splitter - Number of jump tables with unknown hotness
813

914
; When 'partition-static-data-sections' is enabled, static data splitter pass will
1015
; categorize jump tables and assembly printer will place hot jump tables in the
1116
; `.rodata.hot`-prefixed section, and cold ones in the `.rodata.unlikely`-prefixed section.
1217
; Section names will optionally have `.<func>` if -function-sections is enabled.
13-
; RUN: llc -enable-split-machine-functions -partition-static-data-sections=true -function-sections=true -min-jump-table-entries=2 %s -o - 2>&1 | FileCheck %s --check-prefixes=FUNC,JT,DEFAULTHOT
14-
; RUN: llc -enable-split-machine-functions -partition-static-data-sections=true -function-sections=false -min-jump-table-entries=2 %s -o - 2>&1 | FileCheck %s --check-prefixes=FUNCLESS,JT
18+
; RUN: llc -mtriple=x86_64-unknown-linux-gnu -enable-split-machine-functions -partition-static-data-sections=true -function-sections=true -min-jump-table-entries=2 -unique-section-names=false %s -o - 2>&1 | FileCheck %s --check-prefixes=LINEAR,JT
19+
; RUN: llc -mtriple=x86_64-unknown-linux-gnu -enable-split-machine-functions -partition-static-data-sections=true -function-sections=true -min-jump-table-entries=2 %s -o - 2>&1 | FileCheck %s --check-prefixes=FUNC,JT,DEFAULTHOT
20+
; RUN: llc -mtriple=x86_64-unknown-linux-gnu -enable-split-machine-functions -partition-static-data-sections=true -function-sections=false -min-jump-table-entries=2 %s -o - 2>&1 | FileCheck %s --check-prefixes=FUNCLESS,JT --implicit-check-not=unique
1521

16-
; RUN: llc -enable-split-machine-functions -partition-static-data-sections=true -min-jump-table-entries=2 -static-data-default-hotness=cold -function-sections=true %s -o - 2>&1 | FileCheck %s --check-prefixes=FUNC,JT,DEFAULTCOLD
17-
18-
; Tests stat messages are expected.
19-
; STAT-DAG: 2 static-data-splitter - Number of cold jump tables seen
20-
; STAT-DAG: 2 static-data-splitter - Number of hot jump tables seen
21-
; STAT-DAG: 1 static-data-splitter - Number of jump tables with unknown hotness
22+
; Tests that `-static-data-default-hotness` can override hotness for data with
23+
; unknown hotness.
24+
; RUN: llc -mtriple=x86_64-unknown-linux-gnu -enable-split-machine-functions -partition-static-data-sections=true -min-jump-table-entries=2 -static-data-default-hotness=cold -function-sections=true %s -o - 2>&1 | FileCheck %s --check-prefixes=FUNC,JT,DEFAULTCOLD
2225

23-
; Tests that the first and third jump table are placed in a hot-suffixed section,
24-
; and the second and fourth are placed in the original section.
25-
; FUNC: .section .rodata.hot.foo,"a",@progbits
26+
; LINEAR: .section .rodata.hot,"a",@progbits,unique,2
27+
; FUNC: .section .rodata.hot.foo,"a",@progbits
2628
; FUNCLESS: .section .rodata.hot,"a",@progbits
2729
; JT: .LJTI0_0:
2830
; JT: .LJTI0_2:
29-
; FUNC: .section .rodata.unlikely.foo,"a",@progbits
30-
; FUNCLESS: .section .rodata.unlikely,"a",@progbits
31+
; LINEAR: .section .rodata.unlikely,"a",@progbits,unique,3
32+
; FUNC: .section .rodata.unlikely.foo,"a",@progbits
33+
; FUNCLESS: .section .rodata.unlikely,"a",@progbits
3134
; JT: .LJTI0_1:
3235
; JT: .LJTI0_3:
3336
; DEFAULTHOT: .section .rodata.hot.func_without_entry_count,"a",@progbits

0 commit comments

Comments
 (0)