summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-09-23 20:26:38 +0000
committerChris Lattner <sabre@nondot.org>2003-09-23 20:26:38 +0000
commite1a37cba9c8f03d5292c0d420d4ac9dd6226a210 (patch)
tree864b707239408af9e6b35d4bdc11288309a5c70e /test
parent452db67a0e17fea87403962af3fcdef9a05e4eb8 (diff)
downloadllvm-e1a37cba9c8f03d5292c0d420d4ac9dd6226a210.tar.gz
llvm-e1a37cba9c8f03d5292c0d420d4ac9dd6226a210.tar.bz2
llvm-e1a37cba9c8f03d5292c0d420d4ac9dd6226a210.tar.xz
new testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8688 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Transforms/IndVarsSimplify/2003-09-23-NotAtTop.ll16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/Transforms/IndVarsSimplify/2003-09-23-NotAtTop.ll b/test/Transforms/IndVarsSimplify/2003-09-23-NotAtTop.ll
new file mode 100644
index 0000000000..64c1051f34
--- /dev/null
+++ b/test/Transforms/IndVarsSimplify/2003-09-23-NotAtTop.ll
@@ -0,0 +1,16 @@
+; RUN: llvm-as < %s | opt -indvars | llvm-dis | grep -C 1 Loop: | grep Canonical
+
+; The indvar simplification code should ensure that the first PHI in the block
+; is the canonical one!
+
+int %test() {
+ br label %Loop
+Loop:
+ %NonIndvar = phi int [200, %0], [%NonIndvarNext, %Loop]
+ %Canonical = phi int [0, %0], [%CanonicalNext, %Loop]
+
+ %NonIndvarNext = div int %NonIndvar, 2
+ %CanonicalNext = add int %Canonical, 1
+ br label %Loop
+}
+