2013-07-14 15:11:00 +00:00
|
|
|
; RUN: llc < %s | FileCheck %s
|
2013-07-01 19:44:44 +00:00
|
|
|
|
|
|
|
target datalayout = "e-p:16:16:16-i8:8:8-i16:16:16-i32:16:32-n8:16"
|
|
|
|
target triple = "msp430---elf"
|
|
|
|
|
|
|
|
; Function Attrs: nounwind
|
|
|
|
define i16 @test(i16 %i) #0 {
|
|
|
|
entry:
|
2013-07-13 20:38:47 +00:00
|
|
|
; CHECK-LABEL: test:
|
2013-07-01 19:44:44 +00:00
|
|
|
%retval = alloca i16, align 2
|
|
|
|
%i.addr = alloca i16, align 2
|
|
|
|
store i16 %i, i16* %i.addr, align 2
|
2015-02-27 21:17:42 +00:00
|
|
|
%0 = load i16, i16* %i.addr, align 2
|
2013-07-14 15:11:00 +00:00
|
|
|
; CHECK: mov.w #2, r14
|
|
|
|
; CHECK: call #__mulhi3hw_noint
|
2013-07-14 18:19:44 +00:00
|
|
|
; CHECK: br .LJTI0_0(r15)
|
2013-07-01 19:44:44 +00:00
|
|
|
switch i16 %0, label %sw.default [
|
|
|
|
i16 0, label %sw.bb
|
|
|
|
i16 1, label %sw.bb1
|
|
|
|
i16 2, label %sw.bb2
|
|
|
|
i16 3, label %sw.bb3
|
|
|
|
]
|
|
|
|
|
|
|
|
sw.bb: ; preds = %entry
|
|
|
|
store i16 0, i16* %retval
|
|
|
|
br label %return
|
|
|
|
|
|
|
|
sw.bb1: ; preds = %entry
|
|
|
|
store i16 1, i16* %retval
|
|
|
|
br label %return
|
|
|
|
|
|
|
|
sw.bb2: ; preds = %entry
|
|
|
|
store i16 2, i16* %retval
|
|
|
|
br label %return
|
|
|
|
|
|
|
|
sw.bb3: ; preds = %entry
|
|
|
|
store i16 3, i16* %retval
|
|
|
|
br label %return
|
|
|
|
|
|
|
|
sw.default: ; preds = %entry
|
|
|
|
store i16 2, i16* %retval
|
|
|
|
br label %return
|
|
|
|
|
|
|
|
return: ; preds = %sw.default, %sw.bb3, %sw.bb2, %sw.bb1, %sw.bb
|
2015-02-27 21:17:42 +00:00
|
|
|
%1 = load i16, i16* %retval
|
2013-07-01 19:44:44 +00:00
|
|
|
ret i16 %1
|
|
|
|
; CHECK: ret
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: .LJTI0_0:
|
|
|
|
; CHECK-NEXT: .short .LBB0_2
|
|
|
|
; CHECK-NEXT: .short .LBB0_4
|
2013-07-14 15:11:00 +00:00
|
|
|
; CHECK-NEXT: .short .LBB0_3
|
2013-07-01 19:44:44 +00:00
|
|
|
; CHECK-NEXT: .short .LBB0_5
|