Home | History | Annotate | Download | only in Thumb2
      1 ; RUN: llc < %s -mtriple=thumbv7-linux-gnueabihf -O1 %s -o - | FileCheck %s
      2 
      3 ; CHECK-LABEL: test_jump_table:
      4 ; CHECK: b .LBB
      5 ; CHECK-NOT: tbh
      6 
      7 define i32 @test_jump_table(i32 %x, float %in) {
      8 
      9 h1:
     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 
     21 h2:
     22   %a0 = add i32 %x, 5
     23   br label %h3
     24 
     25 h3:
     26   %d2 = phi i32 [%b1, %h1], [%a0, %h2]
     27   %d3 = add i32 %d2, 3
     28   br label %h4
     29 
     30 h4:
     31   %c2 = phi i32 [%b1, %h1], [%d3, %h3]
     32   %c3 = add i32 %c2, 5
     33   br label %h5
     34 
     35 h5:
     36   %a2 = phi i32 [%b1, %h1], [%c3, %h4]
     37   %a3 = add i32 %a2, 6
     38   br label %h6
     39 
     40 h6:
     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 
     47 declare i32 @llvm.arm.space(i32, i32)
     48