1 ; RUN: llc -mtriple=thumbv7s-apple-ios8.0 -o - %s | FileCheck %s
3 declare void @foo(double)
4 declare i32 @llvm.arm.space(i32, i32)
6 ; The constpool entry used to call @foo should be directly between where we want
7 ; the tbb and its table. Fortunately, the flow is simple enough that we can
8 ; eliminate the entry calculation (ADD) and use the ADR as the base.
10 ; I'm hoping this won't be fragile, but if it does break the most likely fix is
11 ; adjusting the @llvm.arm.space call slightly. If this happens too many times
12 ; the test should probably be removed.
13 define i32 @test_jumptable_not_adjacent(i1 %tst, i32 %sw, i32 %l) {
14 ; CHECK-LABEL: test_jumptable_not_adjacent:
15 ; CHECK: vldr {{d[0-9]+}}, [[DBL_CONST:LCPI[0-9]+_[0-9]+]]
17 ; CHECK: adr.w r[[BASE:[0-9]+]], [[JUMP_TABLE:LJTI[0-9]+_[0-9]+]]
18 ; CHECK-NOT: r[[BASE]]
20 ; CHECK: [[TBB_KEY:LCPI[0-9]+_[0-9]+]]:
21 ; CHECK-NEXT: tbb [r[[BASE]], {{r[0-9]+}}]
23 ; CHECK: [[DBL_CONST]]:
26 ; CHECK: [[JUMP_TABLE]]:
27 ; CHECK: .byte (LBB{{[0-9]+}}_{{[0-9]+}}-([[TBB_KEY]]+4)
32 call void @foo(double 12345.0)
33 call i32 @llvm.arm.space(i32 970, i32 undef)
34 switch i32 %sw, label %second [ i32 0, label %other