summaryrefslogtreecommitdiff
path: root/test/CodeGen
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2009-10-11 23:03:28 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2009-10-11 23:03:28 +0000
commitafac8abfc0b85349cdfc4e0f376766bc67d0df3c (patch)
tree51d4fbd9ce6d5009647b628e4ab6b10980ae561e /test/CodeGen
parent2ad8cf5555b7d53cc11f34d6fac019c4028aea25 (diff)
downloadllvm-afac8abfc0b85349cdfc4e0f376766bc67d0df3c.tar.gz
llvm-afac8abfc0b85349cdfc4e0f376766bc67d0df3c.tar.bz2
llvm-afac8abfc0b85349cdfc4e0f376766bc67d0df3c.tar.xz
Add MSP430 mem-mem insts support. Patch by Brian Lucas with some my refinements
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83811 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen')
-rw-r--r--test/CodeGen/MSP430/Inst16mm.ll46
-rw-r--r--test/CodeGen/MSP430/Inst8mm.ll47
2 files changed, 93 insertions, 0 deletions
diff --git a/test/CodeGen/MSP430/Inst16mm.ll b/test/CodeGen/MSP430/Inst16mm.ll
new file mode 100644
index 0000000000..dd4b570f8a
--- /dev/null
+++ b/test/CodeGen/MSP430/Inst16mm.ll
@@ -0,0 +1,46 @@
+; RUN: llvm-as < %s | llc -march=msp430 | 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 @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/Inst8mm.ll b/test/CodeGen/MSP430/Inst8mm.ll
new file mode 100644
index 0000000000..5a128c5ed6
--- /dev/null
+++ b/test/CodeGen/MSP430/Inst8mm.ll
@@ -0,0 +1,47 @@
+; RUN: llvm-as < %s | llc -march=msp430 | 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 @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
+}
+