summaryrefslogtreecommitdiffstats
path: root/llvm/test/Analysis/ScalarEvolution
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/Analysis/ScalarEvolution')
-rw-r--r--llvm/test/Analysis/ScalarEvolution/2007-08-06-Unsigned.ll2
-rw-r--r--llvm/test/Analysis/ScalarEvolution/2008-02-15-UMax.ll17
2 files changed, 18 insertions, 1 deletions
diff --git a/llvm/test/Analysis/ScalarEvolution/2007-08-06-Unsigned.ll b/llvm/test/Analysis/ScalarEvolution/2007-08-06-Unsigned.ll
index e725852cea1..23ffc650b0d 100644
--- a/llvm/test/Analysis/ScalarEvolution/2007-08-06-Unsigned.ll
+++ b/llvm/test/Analysis/ScalarEvolution/2007-08-06-Unsigned.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -scalar-evolution -analyze | grep {Loop bb: ( -1 + ( -1 \\* %x) + %y) iterations!}
+; RUN: llvm-as < %s | opt -scalar-evolution -analyze | grep {Loop bb: ( -1 + ( -1 \\* %x) + (( 1 + %x) umax %y)) iterations!}
; PR1597
define i32 @f(i32 %x, i32 %y) {
diff --git a/llvm/test/Analysis/ScalarEvolution/2008-02-15-UMax.ll b/llvm/test/Analysis/ScalarEvolution/2008-02-15-UMax.ll
new file mode 100644
index 00000000000..0f977f804eb
--- /dev/null
+++ b/llvm/test/Analysis/ScalarEvolution/2008-02-15-UMax.ll
@@ -0,0 +1,17 @@
+; RUN: llvm-as < %s | opt -analyze -scalar-evolution | grep umax
+; PR2003
+
+define i32 @foo(i32 %n) {
+entry:
+ br label %header
+header:
+ %i = phi i32 [ 100, %entry ], [ %i.inc, %next ]
+ %cond = icmp ult i32 %i, %n
+ br i1 %cond, label %next, label %return
+next:
+ %i.inc = add i32 %i, 1
+ br label %header
+return:
+ ret i32 %i
+}
+
OpenPOWER on IntegriCloud