aboutsummaryrefslogtreecommitdiffstats
path: root/test/Analysis/ScalarEvolution/smax.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/Analysis/ScalarEvolution/smax.ll')
-rw-r--r--test/Analysis/ScalarEvolution/smax.ll12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/Analysis/ScalarEvolution/smax.ll b/test/Analysis/ScalarEvolution/smax.ll
new file mode 100644
index 0000000..157d54f
--- /dev/null
+++ b/test/Analysis/ScalarEvolution/smax.ll
@@ -0,0 +1,12 @@
+; RUN: llvm-as < %s | opt -analyze -scalar-evolution | grep smax | count 2
+; RUN: llvm-as < %s | opt -analyze -scalar-evolution | grep \
+; RUN: "%. smax %. smax %."
+; PR1614
+
+define i32 @x(i32 %a, i32 %b, i32 %c) {
+ %A = icmp sgt i32 %a, %b
+ %B = select i1 %A, i32 %a, i32 %b
+ %C = icmp sle i32 %c, %B
+ %D = select i1 %C, i32 %B, i32 %c
+ ret i32 %D
+}