summaryrefslogtreecommitdiff
path: root/test/CodeGen/MSP430
diff options
context:
space:
mode:
authorRoman Divacky <rdivacky@FreeBSD.org>2009-10-14 17:57:32 +0000
committerRoman Divacky <rdivacky@FreeBSD.org>2009-10-14 17:57:32 +0000
commit59850d0874429601812bc13408cb1f776649027c (patch)
treeb21f6de4e08b89bb7931806bab798fc2a5e3a686 /test/CodeGen/MSP430
parent18f153bdb9db52e7089a2d5293b96c45a3124a26 (diff)
downloadsrc-test-59850d0874429601812bc13408cb1f776649027c.tar.gz
src-test-59850d0874429601812bc13408cb1f776649027c.zip
Notes
Diffstat (limited to 'test/CodeGen/MSP430')
-rw-r--r--test/CodeGen/MSP430/2009-05-10-CyclicDAG.ll2
-rw-r--r--test/CodeGen/MSP430/2009-05-17-Rot.ll2
-rw-r--r--test/CodeGen/MSP430/2009-05-17-Shift.ll2
-rw-r--r--test/CodeGen/MSP430/2009-05-19-DoubleSplit.ll2
-rw-r--r--test/CodeGen/MSP430/2009-08-25-DynamicStackAlloc.ll30
-rw-r--r--test/CodeGen/MSP430/2009-09-18-AbsoluteAddr.ll22
-rw-r--r--test/CodeGen/MSP430/2009-10-10-OrImpDef.ll14
-rw-r--r--test/CodeGen/MSP430/Inst16mi.ll48
-rw-r--r--test/CodeGen/MSP430/Inst16mm.ll54
-rw-r--r--test/CodeGen/MSP430/Inst16mr.ll48
-rw-r--r--test/CodeGen/MSP430/Inst16rm.ll38
-rw-r--r--test/CodeGen/MSP430/Inst16rr.ll37
-rw-r--r--test/CodeGen/MSP430/Inst8mi.ll48
-rw-r--r--test/CodeGen/MSP430/Inst8mm.ll55
-rw-r--r--test/CodeGen/MSP430/Inst8mr.ll48
-rw-r--r--test/CodeGen/MSP430/Inst8rm.ll38
-rw-r--r--test/CodeGen/MSP430/Inst8rr.ll38
-rw-r--r--test/CodeGen/MSP430/inline-asm.ll25
18 files changed, 547 insertions, 4 deletions
diff --git a/test/CodeGen/MSP430/2009-05-10-CyclicDAG.ll b/test/CodeGen/MSP430/2009-05-10-CyclicDAG.ll
index 245c2f908bdeb..f339373ffc75a 100644
--- a/test/CodeGen/MSP430/2009-05-10-CyclicDAG.ll
+++ b/test/CodeGen/MSP430/2009-05-10-CyclicDAG.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc
+; RUN: llc < %s
; PR4136
target datalayout = "e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8"
diff --git a/test/CodeGen/MSP430/2009-05-17-Rot.ll b/test/CodeGen/MSP430/2009-05-17-Rot.ll
index c25a906308af0..2ae005259d4fa 100644
--- a/test/CodeGen/MSP430/2009-05-17-Rot.ll
+++ b/test/CodeGen/MSP430/2009-05-17-Rot.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=msp430
+; RUN: llc < %s -march=msp430
define i16 @rol1u16(i16 %x.arg) nounwind {
%retval = alloca i16
diff --git a/test/CodeGen/MSP430/2009-05-17-Shift.ll b/test/CodeGen/MSP430/2009-05-17-Shift.ll
index b048bb3fd32ac..25aff60c2b3ff 100644
--- a/test/CodeGen/MSP430/2009-05-17-Shift.ll
+++ b/test/CodeGen/MSP430/2009-05-17-Shift.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=msp430 | grep rra | count 1
+; RUN: llc < %s -march=msp430 | grep rra | count 1
define i16 @lsr2u16(i16 %x.arg) nounwind {
%retval = alloca i16
diff --git a/test/CodeGen/MSP430/2009-05-19-DoubleSplit.ll b/test/CodeGen/MSP430/2009-05-19-DoubleSplit.ll
index 70f1d996e7cab..54eb7ff5c0bf3 100644
--- a/test/CodeGen/MSP430/2009-05-19-DoubleSplit.ll
+++ b/test/CodeGen/MSP430/2009-05-19-DoubleSplit.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=msp430
+; RUN: llc < %s -march=msp430
define i16 @test(double %d) nounwind {
entry:
diff --git a/test/CodeGen/MSP430/2009-08-25-DynamicStackAlloc.ll b/test/CodeGen/MSP430/2009-08-25-DynamicStackAlloc.ll
new file mode 100644
index 0000000000000..088d3e1e7b37b
--- /dev/null
+++ b/test/CodeGen/MSP430/2009-08-25-DynamicStackAlloc.ll
@@ -0,0 +1,30 @@
+; RUN: llc < %s
+; PR4769
+target datalayout = "e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8"
+target triple = "msp430-generic-generic"
+
+define i16 @foo() nounwind readnone {
+entry:
+ %result = alloca i16, align 1 ; <i16*> [#uses=2]
+ volatile store i16 0, i16* %result
+ %tmp = volatile load i16* %result ; <i16> [#uses=1]
+ ret i16 %tmp
+}
+
+define i16 @main() nounwind {
+entry:
+ br label %while.cond
+
+while.cond: ; preds = %while.cond, %entry
+ %call = call i16 @bar() nounwind ; <i16> [#uses=1]
+ %tobool = icmp eq i16 %call, 0 ; <i1> [#uses=1]
+ br i1 %tobool, label %while.end, label %while.cond
+
+while.end: ; preds = %while.cond
+ %result.i = alloca i16, align 1 ; <i16*> [#uses=2]
+ volatile store i16 0, i16* %result.i
+ %tmp.i = volatile load i16* %result.i ; <i16> [#uses=0]
+ ret i16 0
+}
+
+declare i16 @bar()
diff --git a/test/CodeGen/MSP430/2009-09-18-AbsoluteAddr.ll b/test/CodeGen/MSP430/2009-09-18-AbsoluteAddr.ll
new file mode 100644
index 0000000000000..cc574c7290aba
--- /dev/null
+++ b/test/CodeGen/MSP430/2009-09-18-AbsoluteAddr.ll
@@ -0,0 +1,22 @@
+; RUN: llc < %s | grep 0x0021 | count 2
+; PR4776
+target datalayout = "e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8"
+target triple = "msp430-unknown-unknown"
+
+@"\010x0021" = common global i8 0, align 1 ; <i8*> [#uses=2]
+
+define zeroext i8 @foo(i8 zeroext %x) nounwind {
+entry:
+ %retval = alloca i8 ; <i8*> [#uses=2]
+ %x.addr = alloca i8 ; <i8*> [#uses=2]
+ %tmp = alloca i8, align 1 ; <i8*> [#uses=2]
+ store i8 %x, i8* %x.addr
+ %tmp1 = volatile load i8* @"\010x0021" ; <i8> [#uses=1]
+ store i8 %tmp1, i8* %tmp
+ %tmp2 = load i8* %x.addr ; <i8> [#uses=1]
+ volatile store i8 %tmp2, i8* @"\010x0021"
+ %tmp3 = load i8* %tmp ; <i8> [#uses=1]
+ store i8 %tmp3, i8* %retval
+ %0 = load i8* %retval ; <i8> [#uses=1]
+ ret i8 %0
+}
diff --git a/test/CodeGen/MSP430/2009-10-10-OrImpDef.ll b/test/CodeGen/MSP430/2009-10-10-OrImpDef.ll
new file mode 100644
index 0000000000000..856eb9db3f6b3
--- /dev/null
+++ b/test/CodeGen/MSP430/2009-10-10-OrImpDef.ll
@@ -0,0 +1,14 @@
+; RUN: llc -march=msp430 < %s
+; PR4779
+define void @foo() nounwind {
+entry:
+ %r = alloca i8 ; <i8*> [#uses=2]
+ %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
+ volatile load i8* %r, align 1 ; <i8>:0 [#uses=1]
+ or i8 %0, 1 ; <i8>:1 [#uses=1]
+ volatile store i8 %1, i8* %r, align 1
+ br label %return
+
+return: ; preds = %entry
+ ret void
+}
diff --git a/test/CodeGen/MSP430/Inst16mi.ll b/test/CodeGen/MSP430/Inst16mi.ll
new file mode 100644
index 0000000000000..33d7aa495d3c2
--- /dev/null
+++ b/test/CodeGen/MSP430/Inst16mi.ll
@@ -0,0 +1,48 @@
+; RUN: llc -march=msp430 < %s | FileCheck %s
+
+target datalayout = "e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8"
+target triple = "msp430-generic-generic"
+@foo = common global i16 0, align 2
+
+define void @mov() nounwind {
+; CHECK: mov:
+; CHECK: mov.w #2, &foo
+ store i16 2, i16 * @foo
+ ret void
+}
+
+define void @add() nounwind {
+; CHECK: add:
+; CHECK: add.w #2, &foo
+ %1 = load i16* @foo
+ %2 = add i16 %1, 2
+ store i16 %2, i16 * @foo
+ ret void
+}
+
+define void @and() nounwind {
+; CHECK: and:
+; CHECK: and.w #2, &foo
+ %1 = load i16* @foo
+ %2 = and i16 %1, 2
+ store i16 %2, i16 * @foo
+ ret void
+}
+
+define void @bis() nounwind {
+; CHECK: bis:
+; CHECK: bis.w #2, &foo
+ %1 = load i16* @foo
+ %2 = or i16 %1, 2
+ store i16 %2, i16 * @foo
+ ret void
+}
+
+define void @xor() nounwind {
+; CHECK: xor:
+; CHECK: xor.w #2, &foo
+ %1 = load i16* @foo
+ %2 = xor i16 %1, 2
+ store i16 %2, i16 * @foo
+ ret void
+}
diff --git a/test/CodeGen/MSP430/Inst16mm.ll b/test/CodeGen/MSP430/Inst16mm.ll
new file mode 100644
index 0000000000000..510afe373494a
--- /dev/null
+++ b/test/CodeGen/MSP430/Inst16mm.ll
@@ -0,0 +1,54 @@
+; RUN: llc -march=msp430 < %s | FileCheck %s
+target datalayout = "e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8"
+target triple = "msp430-generic-generic"
+@foo = common global i16 0, align 2
+@bar = common global i16 0, align 2
+
+define void @mov() nounwind {
+; CHECK: mov:
+; CHECK: mov.w &bar, &foo
+ %1 = load i16* @bar
+ store i16 %1, i16* @foo
+ ret void
+}
+
+define void @add() nounwind {
+; CHECK: add:
+; CHECK: add.w &bar, &foo
+ %1 = load i16* @bar
+ %2 = load i16* @foo
+ %3 = add i16 %2, %1
+ store i16 %3, i16* @foo
+ ret void
+}
+
+define void @and() nounwind {
+; CHECK: and:
+; CHECK: and.w &bar, &foo
+ %1 = load i16* @bar
+ %2 = load i16* @foo
+ %3 = and i16 %2, %1
+ store i16 %3, i16* @foo
+ ret void
+}
+
+define void @bis() nounwind {
+; CHECK: bis:
+; CHECK: bis.w &bar, &foo
+ %1 = load i16* @bar
+ %2 = load i16* @foo
+ %3 = or i16 %2, %1
+ store i16 %3, i16* @foo
+ ret void
+}
+
+define void @xor() nounwind {
+; CHECK: xor:
+; CHECK: xor.w &bar, &foo
+ %1 = load i16* @bar
+ %2 = load i16* @foo
+ %3 = xor i16 %2, %1
+ store i16 %3, i16* @foo
+ ret void
+}
+
diff --git a/test/CodeGen/MSP430/Inst16mr.ll b/test/CodeGen/MSP430/Inst16mr.ll
new file mode 100644
index 0000000000000..53334aa748e98
--- /dev/null
+++ b/test/CodeGen/MSP430/Inst16mr.ll
@@ -0,0 +1,48 @@
+; RUN: llc -march=msp430 < %s | FileCheck %s
+target datalayout = "e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8"
+target triple = "msp430-generic-generic"
+@foo = common global i16 0, align 2
+
+define void @mov(i16 %a) nounwind {
+; CHECK: mov:
+; CHECK: mov.w r15, &foo
+ store i16 %a, i16* @foo
+ ret void
+}
+
+define void @add(i16 %a) nounwind {
+; CHECK: add:
+; CHECK: add.w r15, &foo
+ %1 = load i16* @foo
+ %2 = add i16 %a, %1
+ store i16 %2, i16* @foo
+ ret void
+}
+
+define void @and(i16 %a) nounwind {
+; CHECK: and:
+; CHECK: and.w r15, &foo
+ %1 = load i16* @foo
+ %2 = and i16 %a, %1
+ store i16 %2, i16* @foo
+ ret void
+}
+
+define void @bis(i16 %a) nounwind {
+; CHECK: bis:
+; CHECK: bis.w r15, &foo
+ %1 = load i16* @foo
+ %2 = or i16 %a, %1
+ store i16 %2, i16* @foo
+ ret void
+}
+
+define void @xor(i16 %a) nounwind {
+; CHECK: xor:
+; CHECK: xor.w r15, &foo
+ %1 = load i16* @foo
+ %2 = xor i16 %a, %1
+ store i16 %2, i16* @foo
+ ret void
+}
+
diff --git a/test/CodeGen/MSP430/Inst16rm.ll b/test/CodeGen/MSP430/Inst16rm.ll
new file mode 100644
index 0000000000000..d0cb0d19b938c
--- /dev/null
+++ b/test/CodeGen/MSP430/Inst16rm.ll
@@ -0,0 +1,38 @@
+; RUN: llc -march=msp430 < %s | FileCheck %s
+target datalayout = "e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8"
+target triple = "msp430-generic-generic"
+@foo = common global i16 0, align 2
+
+define i16 @add(i16 %a) nounwind {
+; CHECK: add:
+; CHECK: add.w &foo, r15
+ %1 = load i16* @foo
+ %2 = add i16 %a, %1
+ ret i16 %2
+}
+
+define i16 @and(i16 %a) nounwind {
+; CHECK: and:
+; CHECK: and.w &foo, r15
+ %1 = load i16* @foo
+ %2 = and i16 %a, %1
+ ret i16 %2
+}
+
+
+define i16 @bis(i16 %a) nounwind {
+; CHECK: bis:
+; CHECK: bis.w &foo, r15
+ %1 = load i16* @foo
+ %2 = or i16 %a, %1
+ ret i16 %2
+}
+
+define i16 @xor(i16 %a) nounwind {
+; CHECK: xor:
+; CHECK: xor.w &foo, r15
+ %1 = load i16* @foo
+ %2 = xor i16 %a, %1
+ ret i16 %2
+}
+
diff --git a/test/CodeGen/MSP430/Inst16rr.ll b/test/CodeGen/MSP430/Inst16rr.ll
new file mode 100644
index 0000000000000..6619c51823648
--- /dev/null
+++ b/test/CodeGen/MSP430/Inst16rr.ll
@@ -0,0 +1,37 @@
+; RUN: llc -march=msp430 < %s | FileCheck %s
+target datalayout = "e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8"
+target triple = "msp430-generic-generic"
+
+define i16 @mov(i16 %a, i16 %b) nounwind {
+; CHECK: mov:
+; CHECK: mov.w r14, r15
+ ret i16 %b
+}
+
+define i16 @add(i16 %a, i16 %b) nounwind {
+; CHECK: add:
+; CHECK: add.w r14, r15
+ %1 = add i16 %a, %b
+ ret i16 %1
+}
+
+define i16 @and(i16 %a, i16 %b) nounwind {
+; CHECK: and:
+; CHECK: and.w r14, r15
+ %1 = and i16 %a, %b
+ ret i16 %1
+}
+
+define i16 @bis(i16 %a, i16 %b) nounwind {
+; CHECK: bis:
+; CHECK: bis.w r14, r15
+ %1 = or i16 %a, %b
+ ret i16 %1
+}
+
+define i16 @xor(i16 %a, i16 %b) nounwind {
+; CHECK: xor:
+; CHECK: xor.w r14, r15
+ %1 = xor i16 %a, %b
+ ret i16 %1
+}
diff --git a/test/CodeGen/MSP430/Inst8mi.ll b/test/CodeGen/MSP430/Inst8mi.ll
new file mode 100644
index 0000000000000..ef318ce1590da
--- /dev/null
+++ b/test/CodeGen/MSP430/Inst8mi.ll
@@ -0,0 +1,48 @@
+; RUN: llc -march=msp430 < %s | FileCheck %s
+target datalayout = "e-p:16:8:8-i8:8:8-i8:8:8-i32:8:8"
+target triple = "msp430-generic-generic"
+@foo = common global i8 0, align 1
+
+define void @mov() nounwind {
+; CHECK: mov:
+; CHECK: mov.b #2, &foo
+ store i8 2, i8 * @foo
+ ret void
+}
+
+define void @add() nounwind {
+; CHECK: add:
+; CHECK: add.b #2, &foo
+ %1 = load i8* @foo
+ %2 = add i8 %1, 2
+ store i8 %2, i8 * @foo
+ ret void
+}
+
+define void @and() nounwind {
+; CHECK: and:
+; CHECK: and.b #2, &foo
+ %1 = load i8* @foo
+ %2 = and i8 %1, 2
+ store i8 %2, i8 * @foo
+ ret void
+}
+
+define void @bis() nounwind {
+; CHECK: bis:
+; CHECK: bis.b #2, &foo
+ %1 = load i8* @foo
+ %2 = or i8 %1, 2
+ store i8 %2, i8 * @foo
+ ret void
+}
+
+define void @xor() nounwind {
+; CHECK: xor:
+; CHECK: xor.b #2, &foo
+ %1 = load i8* @foo
+ %2 = xor i8 %1, 2
+ store i8 %2, i8 * @foo
+ ret void
+}
+
diff --git a/test/CodeGen/MSP430/Inst8mm.ll b/test/CodeGen/MSP430/Inst8mm.ll
new file mode 100644
index 0000000000000..a2987ac9b46de
--- /dev/null
+++ b/test/CodeGen/MSP430/Inst8mm.ll
@@ -0,0 +1,55 @@
+; RUN: llc -march=msp430 < %s | FileCheck %s
+target datalayout = "e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8"
+target triple = "msp430-generic-generic"
+
+@foo = common global i8 0, align 1
+@bar = common global i8 0, align 1
+
+define void @mov() nounwind {
+; CHECK: mov:
+; CHECK: mov.b &bar, &foo
+ %1 = load i8* @bar
+ store i8 %1, i8* @foo
+ ret void
+}
+
+define void @add() nounwind {
+; CHECK: add:
+; CHECK: add.b &bar, &foo
+ %1 = load i8* @bar
+ %2 = load i8* @foo
+ %3 = add i8 %2, %1
+ store i8 %3, i8* @foo
+ ret void
+}
+
+define void @and() nounwind {
+; CHECK: and:
+; CHECK: and.b &bar, &foo
+ %1 = load i8* @bar
+ %2 = load i8* @foo
+ %3 = and i8 %2, %1
+ store i8 %3, i8* @foo
+ ret void
+}
+
+define void @bis() nounwind {
+; CHECK: bis:
+; CHECK: bis.b &bar, &foo
+ %1 = load i8* @bar
+ %2 = load i8* @foo
+ %3 = or i8 %2, %1
+ store i8 %3, i8* @foo
+ ret void
+}
+
+define void @xor() nounwind {
+; CHECK: xor:
+; CHECK: xor.b &bar, &foo
+ %1 = load i8* @bar
+ %2 = load i8* @foo
+ %3 = xor i8 %2, %1
+ store i8 %3, i8* @foo
+ ret void
+}
+
diff --git a/test/CodeGen/MSP430/Inst8mr.ll b/test/CodeGen/MSP430/Inst8mr.ll
new file mode 100644
index 0000000000000..04c681ef29f27
--- /dev/null
+++ b/test/CodeGen/MSP430/Inst8mr.ll
@@ -0,0 +1,48 @@
+; RUN: llc -march=msp430 < %s | FileCheck %s
+target datalayout = "e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8"
+target triple = "msp430-generic-generic"
+@foo = common global i8 0, align 1
+
+define void @mov(i8 %a) nounwind {
+; CHECK: mov:
+; CHECK: mov.b r15, &foo
+ store i8 %a, i8* @foo
+ ret void
+}
+
+define void @and(i8 %a) nounwind {
+; CHECK: and:
+; CHECK: and.b r15, &foo
+ %1 = load i8* @foo
+ %2 = and i8 %a, %1
+ store i8 %2, i8* @foo
+ ret void
+}
+
+define void @add(i8 %a) nounwind {
+; CHECK: add:
+; CHECK: add.b r15, &foo
+ %1 = load i8* @foo
+ %2 = add i8 %a, %1
+ store i8 %2, i8* @foo
+ ret void
+}
+
+define void @bis(i8 %a) nounwind {
+; CHECK: bis:
+; CHECK: bis.b r15, &foo
+ %1 = load i8* @foo
+ %2 = or i8 %a, %1
+ store i8 %2, i8* @foo
+ ret void
+}
+
+define void @xor(i8 %a) nounwind {
+; CHECK: xor:
+; CHECK: xor.b r15, &foo
+ %1 = load i8* @foo
+ %2 = xor i8 %a, %1
+ store i8 %2, i8* @foo
+ ret void
+}
+
diff --git a/test/CodeGen/MSP430/Inst8rm.ll b/test/CodeGen/MSP430/Inst8rm.ll
new file mode 100644
index 0000000000000..62a5d4b9088b1
--- /dev/null
+++ b/test/CodeGen/MSP430/Inst8rm.ll
@@ -0,0 +1,38 @@
+; RUN: llc -march=msp430 < %s | FileCheck %s
+target datalayout = "e-p:16:8:8-i8:8:8-i8:8:8-i32:8:8"
+target triple = "msp430-generic-generic"
+@foo = common global i8 0, align 1
+
+define i8 @add(i8 %a) nounwind {
+; CHECK: add:
+; CHECK: add.b &foo, r15
+ %1 = load i8* @foo
+ %2 = add i8 %a, %1
+ ret i8 %2
+}
+
+define i8 @and(i8 %a) nounwind {
+; CHECK: and:
+; CHECK: and.b &foo, r15
+ %1 = load i8* @foo
+ %2 = and i8 %a, %1
+ ret i8 %2
+}
+
+
+define i8 @bis(i8 %a) nounwind {
+; CHECK: bis:
+; CHECK: bis.b &foo, r15
+ %1 = load i8* @foo
+ %2 = or i8 %a, %1
+ ret i8 %2
+}
+
+define i8 @xor(i8 %a) nounwind {
+; CHECK: xor:
+; CHECK: xor.b &foo, r15
+ %1 = load i8* @foo
+ %2 = xor i8 %a, %1
+ ret i8 %2
+}
+
diff --git a/test/CodeGen/MSP430/Inst8rr.ll b/test/CodeGen/MSP430/Inst8rr.ll
new file mode 100644
index 0000000000000..90ea94516abd6
--- /dev/null
+++ b/test/CodeGen/MSP430/Inst8rr.ll
@@ -0,0 +1,38 @@
+; RUN: llc -march=msp430 < %s | FileCheck %s
+target datalayout = "e-p:16:8:8-i8:8:8-i8:8:8-i32:8:8"
+target triple = "msp430-generic-generic"
+
+define i8 @mov(i8 %a, i8 %b) nounwind {
+; CHECK: mov:
+; CHECK: mov.b r14, r15
+ ret i8 %b
+}
+
+define i8 @add(i8 %a, i8 %b) nounwind {
+; CHECK: add:
+; CHECK: add.b r14, r15
+ %1 = add i8 %a, %b
+ ret i8 %1
+}
+
+define i8 @and(i8 %a, i8 %b) nounwind {
+; CHECK: and:
+; CHECK: and.w r14, r15
+ %1 = and i8 %a, %b
+ ret i8 %1
+}
+
+define i8 @bis(i8 %a, i8 %b) nounwind {
+; CHECK: bis:
+; CHECK: bis.w r14, r15
+ %1 = or i8 %a, %b
+ ret i8 %1
+}
+
+define i8 @xor(i8 %a, i8 %b) nounwind {
+; CHECK: xor:
+; CHECK: xor.w r14, r15
+ %1 = xor i8 %a, %b
+ ret i8 %1
+}
+
diff --git a/test/CodeGen/MSP430/inline-asm.ll b/test/CodeGen/MSP430/inline-asm.ll
new file mode 100644
index 0000000000000..2cc25a4835d61
--- /dev/null
+++ b/test/CodeGen/MSP430/inline-asm.ll
@@ -0,0 +1,25 @@
+; RUN: llc < %s
+target datalayout = "e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8"
+target triple = "msp430-generic-generic"
+
+define void @imm() nounwind {
+ call void asm sideeffect "bic\09$0,r2", "i"(i16 32) nounwind
+ ret void
+}
+
+define void @reg(i16 %a) nounwind {
+ call void asm sideeffect "bic\09$0,r2", "r"(i16 %a) nounwind
+ ret void
+}
+
+@foo = global i16 0, align 2
+
+define void @immmem() nounwind {
+ call void asm sideeffect "bic\09$0,r2", "i"(i16* getelementptr(i16* @foo, i32 1)) nounwind
+ ret void
+}
+
+define void @mem() nounwind {
+ call void asm sideeffect "bic\09$0,r2", "m"(i16* @foo) nounwind
+ ret void
+}