summaryrefslogtreecommitdiff
path: root/test/CodeGen/MSP430
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2009-11-07 17:15:06 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2009-11-07 17:15:06 +0000
commit6534f83ae8c39284ae51fbf478ce0c37d0c892a2 (patch)
treebc7f6b5215bd2a3162233cd58983bc1fc482e36f /test/CodeGen/MSP430
parent8983da729aa1ca99a11a3b98ae6280dfcdbadb39 (diff)
downloadllvm-6534f83ae8c39284ae51fbf478ce0c37d0c892a2.tar.gz
llvm-6534f83ae8c39284ae51fbf478ce0c37d0c892a2.tar.bz2
llvm-6534f83ae8c39284ae51fbf478ce0c37d0c892a2.tar.xz
Add some dummy support for post-incremented loads
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86385 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/MSP430')
-rw-r--r--test/CodeGen/MSP430/postinc.ll25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/CodeGen/MSP430/postinc.ll b/test/CodeGen/MSP430/postinc.ll
new file mode 100644
index 0000000000..424b4f79cd
--- /dev/null
+++ b/test/CodeGen/MSP430/postinc.ll
@@ -0,0 +1,25 @@
+; RUN: llc < %s | FileCheck %s
+target datalayout = "e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8"
+target triple = "msp430"
+
+define zeroext i16 @add(i16* nocapture %a, i16 zeroext %n) nounwind readonly {
+entry:
+ %cmp8 = icmp eq i16 %n, 0 ; <i1> [#uses=1]
+ br i1 %cmp8, label %for.end, label %for.body
+
+for.body: ; preds = %for.body, %entry
+ %i.010 = phi i16 [ 0, %entry ], [ %inc, %for.body ] ; <i16> [#uses=2]
+ %sum.09 = phi i16 [ 0, %entry ], [ %add, %for.body ] ; <i16> [#uses=1]
+ %arrayidx = getelementptr i16* %a, i16 %i.010 ; <i16*> [#uses=1]
+; CHECK: add:
+; CHECK: mov.w @r15+, r11
+ %tmp4 = load i16* %arrayidx ; <i16> [#uses=1]
+ %add = add i16 %tmp4, %sum.09 ; <i16> [#uses=2]
+ %inc = add i16 %i.010, 1 ; <i16> [#uses=2]
+ %exitcond = icmp eq i16 %inc, %n ; <i1> [#uses=1]
+ br i1 %exitcond, label %for.end, label %for.body
+
+for.end: ; preds = %for.body, %entry
+ %sum.0.lcssa = phi i16 [ 0, %entry ], [ %add, %for.body ] ; <i16> [#uses=1]
+ ret i16 %sum.0.lcssa
+}