aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/ARM/arm-negative-stride.ll
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-04-03 00:13:16 +0000
committerChris Lattner <sabre@nondot.org>2007-04-03 00:13:16 +0000
commitbaf21999a95684d68c96e34c4ac75def9e02d2d6 (patch)
tree9898c1742d4f8aa87513667eb3d790669203a679 /test/CodeGen/ARM/arm-negative-stride.ll
parent1d31290634eccc3b360c427282d59780d76b9169 (diff)
downloadexternal_llvm-baf21999a95684d68c96e34c4ac75def9e02d2d6.zip
external_llvm-baf21999a95684d68c96e34c4ac75def9e02d2d6.tar.gz
external_llvm-baf21999a95684d68c96e34c4ac75def9e02d2d6.tar.bz2
new testcase, where we should use a negative stride
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35608 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/ARM/arm-negative-stride.ll')
-rw-r--r--test/CodeGen/ARM/arm-negative-stride.ll20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/CodeGen/ARM/arm-negative-stride.ll b/test/CodeGen/ARM/arm-negative-stride.ll
new file mode 100644
index 0000000..272f2a5
--- /dev/null
+++ b/test/CodeGen/ARM/arm-negative-stride.ll
@@ -0,0 +1,20 @@
+; RUN: llvm-as < %s | llc -march=arm | grep -F 'str r1, [r3, -r0, lsl #2]'
+
+define void @test(i32* %P, i32 %A, i32 %i) {
+entry:
+ icmp eq i32 %i, 0 ; <i1>:0 [#uses=1]
+ br i1 %0, label %return, label %bb
+
+bb: ; preds = %bb, %entry
+ %indvar = phi i32 [ 0, %entry ], [ %indvar.next, %bb ] ; <i32> [#uses=2]
+ %i_addr.09.0 = sub i32 %i, %indvar ; <i32> [#uses=1]
+ %tmp2 = getelementptr i32* %P, i32 %i_addr.09.0 ; <i32*> [#uses=1]
+ store i32 %A, i32* %tmp2
+ %indvar.next = add i32 %indvar, 1 ; <i32> [#uses=2]
+ icmp eq i32 %indvar.next, %i ; <i1>:1 [#uses=1]
+ br i1 %1, label %return, label %bb
+
+return: ; preds = %bb, %entry
+ ret void
+}
+