1 ; RUN: llc -o - %s -mtriple=aarch64-none-linux-gnu -mattr=+force-32bit-jump-tables -aarch64-min-jump-table-entries=4 -aarch64-enable-atomic-cfg-tidy=0 | FileCheck %s
2 ; RUN: llc -o - %s -mtriple=aarch64-none-linux-gnu -mcpu=exynos-m3 -aarch64-min-jump-table-entries=4 -aarch64-enable-atomic-cfg-tidy=0 | FileCheck %s
4 ; Exynos doesn't want jump tables to be compressed for now.
6 define i32 @test_jumptable(i32 %in) {
7 switch i32 %in, label %def [
13 ; CHECK-LABEL: test_jumptable:
14 ; CHECK: adrp [[JTPAGE:x[0-9]+]], .LJTI0_0
15 ; CHECK: add x[[JT:[0-9]+]], [[JTPAGE]], {{#?}}:lo12:.LJTI0_0
16 ; CHECK: [[PCREL_LBL:.Ltmp.*]]:
17 ; CHECK-NEXT: adr [[PCBASE:x[0-9]+]], [[PCREL_LBL]]
18 ; CHECK: ldrsw x[[OFFSET:[0-9]+]], [x[[JT]], {{x[0-9]+}}, lsl #2]
19 ; CHECK: add [[DEST:x[0-9]+]], [[PCBASE]], x[[OFFSET]]
24 ; CHECK-NEXT: .word .LBB{{.*}}-[[PCREL_LBL]]
43 define i32 @test_jumptable_minsize(i32 %in) minsize {
44 switch i32 %in, label %def [
50 ; CHECK-LABEL: test_jumptable_minsize:
51 ; CHECK: adrp [[JTPAGE:x[0-9]+]], .LJTI1_0
52 ; CHECK: add x[[JT:[0-9]+]], [[JTPAGE]], {{#?}}:lo12:.LJTI1_0
53 ; CHECK: adr [[PCBASE:x[0-9]+]], [[JTBASE:.LBB[0-9]+_[0-9]+]]
54 ; CHECK: ldrb w[[OFFSET:[0-9]+]], [x[[JT]], {{x[0-9]+}}]
55 ; CHECK: add [[DEST:x[0-9]+]], [[PCBASE]], x[[OFFSET]], lsl #2