summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2008-11-03 02:43:49 +0000
committerNick Lewycky <nicholas@mxc.ca>2008-11-03 02:43:49 +0000
commit8f4d5eb9e543d22df61a98c4115ed81887213333 (patch)
tree04066da191d4667976b4a33ffb275ab223c9d3a2 /test
parentae61ca02061cc500cb9f093a492899658249a245 (diff)
downloadllvm-8f4d5eb9e543d22df61a98c4115ed81887213333.tar.gz
llvm-8f4d5eb9e543d22df61a98c4115ed81887213333.tar.bz2
llvm-8f4d5eb9e543d22df61a98c4115ed81887213333.tar.xz
Don't crash analyzing certain quadratics (addrec of {X,+,Y,+,1}).
We're still waiting on code that actually analyzes them properly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58592 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Analysis/ScalarEvolution/2008-11-02-QuadraticCrash.ll21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/Analysis/ScalarEvolution/2008-11-02-QuadraticCrash.ll b/test/Analysis/ScalarEvolution/2008-11-02-QuadraticCrash.ll
new file mode 100644
index 0000000000..c6cb87fca1
--- /dev/null
+++ b/test/Analysis/ScalarEvolution/2008-11-02-QuadraticCrash.ll
@@ -0,0 +1,21 @@
+; RUN: llvm-as < %s | opt -analyze -scalar-evolution
+; PR1827
+
+declare void @use(i32)
+
+define void @foo() {
+entry:
+ br label %loop_1
+
+loop_1: ; preds = %loop_1, %entry
+ %a = phi i32 [ 2, %entry ], [ %b, %loop_1 ] ; <i32> [#uses=2]
+ %c = phi i32 [ 5, %entry ], [ %d, %loop_1 ] ; <i32> [#uses=1]
+ %b = add i32 %a, 1 ; <i32> [#uses=1]
+ %d = add i32 %c, %a ; <i32> [#uses=3]
+ %A = icmp ult i32 %d, 50 ; <i1> [#uses=1]
+ br i1 %A, label %loop_1, label %endloop
+
+endloop: ; preds = %loop_1
+ call void @use(i32 %d)
+ ret void
+}