blob: 5ffe1f9b09f6ba0a1a362fa9e37c62bd542cc76f [file] [log] [blame]
Chad Rosier620fb222014-12-12 23:27:40 +00001; RUN: llc < %s -mtriple=thumbv7-linux-gnueabihf -O1 %s -o - | FileCheck %s
2
3; CHECK-LABEL: test_jump_table:
Tim Northovera603c402015-05-31 19:22:07 +00004; CHECK: b{{.*}} .LBB
Chad Rosier620fb222014-12-12 23:27:40 +00005; CHECK-NOT: tbh
6
7define i32 @test_jump_table(i32 %x, float %in) {
8
9h1:
10
11 %b0 = fadd float %in, 1234.5
12 %b1 = fptoui float %b0 to i32
13
14 switch i32 %x, label %h2 [
15 i32 0, label %h3
16 i32 2, label %h4
17 i32 4, label %h5
18 i32 6, label %h6
19 ]
20
21h2:
22 %a0 = add i32 %x, 5
23 br label %h3
24
25h3:
26 %d2 = phi i32 [%b1, %h1], [%a0, %h2]
27 %d3 = add i32 %d2, 3
28 br label %h4
29
30h4:
31 %c2 = phi i32 [%b1, %h1], [%d3, %h3]
32 %c3 = add i32 %c2, 5
33 br label %h5
34
35h5:
36 %a2 = phi i32 [%b1, %h1], [%c3, %h4]
37 %a3 = add i32 %a2, 6
38 br label %h6
39
40h6:
41 %y = phi i32 [0, %h1], [%a3, %h5]
42 call i32 @llvm.arm.space(i32 2000, i32 undef)
43 ret i32 %y
44
45}
46
47declare i32 @llvm.arm.space(i32, i32)