aboutsummaryrefslogtreecommitdiffstats
path: root/test/Analysis
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2007-11-15 06:30:50 +0000
committerNick Lewycky <nicholas@mxc.ca>2007-11-15 06:30:50 +0000
commit65e2da3b4d6925bf30693595a524a3a43acc1f17 (patch)
treef6a9dda2e86a3aa0d761779dd95ba4b7931bcf40 /test/Analysis
parent701bc4264d3b6f9f7c8192f96a953d6815a7cb64 (diff)
downloadexternal_llvm-65e2da3b4d6925bf30693595a524a3a43acc1f17.zip
external_llvm-65e2da3b4d6925bf30693595a524a3a43acc1f17.tar.gz
external_llvm-65e2da3b4d6925bf30693595a524a3a43acc1f17.tar.bz2
Fix handling of overflow in loop calculation by adding new UDiv SCEV. This SCEV
is disabled in the sense that it will refuse to create one from a UDiv instruction, until the code is better tested. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44163 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis')
-rw-r--r--test/Analysis/ScalarEvolution/2007-11-14-SignedAddRec.ll24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/Analysis/ScalarEvolution/2007-11-14-SignedAddRec.ll b/test/Analysis/ScalarEvolution/2007-11-14-SignedAddRec.ll
new file mode 100644
index 0000000..66ca755
--- /dev/null
+++ b/test/Analysis/ScalarEvolution/2007-11-14-SignedAddRec.ll
@@ -0,0 +1,24 @@
+; RUN: llvm-as < %s | opt -indvars | llvm-dis | grep printd | grep 1206807378
+; PR1798
+
+declare void @printd(i32)
+
+define i32 @test() {
+entry:
+ br label %bb6
+
+bb: ; preds = %bb6
+ %tmp3 = add i32 %x.0, %i.0 ; <i32> [#uses=1]
+ %tmp5 = add i32 %i.0, 1 ; <i32> [#uses=1]
+ br label %bb6
+
+bb6: ; preds = %bb, %entry
+ %i.0 = phi i32 [ 0, %entry ], [ %tmp5, %bb ] ; <i32> [#uses=3]
+ %x.0 = phi i32 [ 0, %entry ], [ %tmp3, %bb ] ; <i32> [#uses=3]
+ %tmp8 = icmp slt i32 %i.0, 123456789 ; <i1> [#uses=1]
+ br i1 %tmp8, label %bb, label %bb10
+
+bb10: ; preds = %bb6
+ call void @printd(i32 %x.0)
+ ret i32 0
+}