new testcase for cananonicalization of subtracts
authorChris Lattner <sabre@nondot.org>
Mon, 22 Dec 2003 05:24:45 +0000 (05:24 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 22 Dec 2003 05:24:45 +0000 (05:24 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10581 91177308-0d34-0410-b5e6-96231b3b80d8

test/Transforms/IndVarsSimplify/subtract.ll [new file with mode: 0644]

diff --git a/test/Transforms/IndVarsSimplify/subtract.ll b/test/Transforms/IndVarsSimplify/subtract.ll
new file mode 100644 (file)
index 0000000..49f4089
--- /dev/null
@@ -0,0 +1,12 @@
+; RUN: llvm-as < %s | opt -indvars | llvm-dis | grep indvar
+
+%G = global long 0
+
+void %test(long %V) {
+       br label %Loop
+Loop:
+       %X = phi long [1, %0], [%X.next, %Loop]
+       %X.next = sub long %X, %V
+       store long %X, long* %G
+       br label %Loop
+}