Home | History | Annotate | Download | only in MSP430
      1 ; RUN: llc < %s | FileCheck %s
      2 
      3 target datalayout = "e-p:16:16:16-i8:8:8-i16:16:16-i32:16:32-n8:16"
      4 target triple = "msp430---elf"
      5 
      6 ; Function Attrs: nounwind
      7 define i16 @test(i16 %i) #0 {
      8 entry:
      9 ; CHECK-LABEL: test:
     10   %retval = alloca i16, align 2
     11   %i.addr = alloca i16, align 2
     12   store i16 %i, i16* %i.addr, align 2
     13   %0 = load i16* %i.addr, align 2
     14 ; CHECK: mov.w #2, r14
     15 ; CHECK: call #__mulhi3hw_noint
     16 ; CHECK: br .LJTI0_0(r15)
     17   switch i16 %0, label %sw.default [
     18     i16 0, label %sw.bb
     19     i16 1, label %sw.bb1
     20     i16 2, label %sw.bb2
     21     i16 3, label %sw.bb3
     22   ]
     23 
     24 sw.bb:                                            ; preds = %entry
     25   store i16 0, i16* %retval
     26   br label %return
     27 
     28 sw.bb1:                                           ; preds = %entry
     29   store i16 1, i16* %retval
     30   br label %return
     31 
     32 sw.bb2:                                           ; preds = %entry
     33   store i16 2, i16* %retval
     34   br label %return
     35 
     36 sw.bb3:                                           ; preds = %entry
     37   store i16 3, i16* %retval
     38   br label %return
     39 
     40 sw.default:                                       ; preds = %entry
     41   store i16 2, i16* %retval
     42   br label %return
     43 
     44 return:                                           ; preds = %sw.default, %sw.bb3, %sw.bb2, %sw.bb1, %sw.bb
     45   %1 = load i16* %retval
     46   ret i16 %1
     47 ; CHECK: ret
     48 }
     49 
     50 ; CHECK: .LJTI0_0:
     51 ; CHECK-NEXT: .short .LBB0_2
     52 ; CHECK-NEXT: .short .LBB0_4
     53 ; CHECK-NEXT: .short .LBB0_3
     54 ; CHECK-NEXT: .short .LBB0_5
     55