aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/InstSimplify
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2011-07-01 01:03:43 +0000
committerDan Gohman <gohman@apple.com>2011-07-01 01:03:43 +0000
commit68c0dbc14fb7599987fb3e27be4e12c1ac36535e (patch)
treed1eb614605e080339290cc5405e433c3b2ffd0ea /test/Transforms/InstSimplify
parent5e653c925c7da969c3fb5fa9a46263ffb160b81e (diff)
downloadexternal_llvm-68c0dbc14fb7599987fb3e27be4e12c1ac36535e.zip
external_llvm-68c0dbc14fb7599987fb3e27be4e12c1ac36535e.tar.gz
external_llvm-68c0dbc14fb7599987fb3e27be4e12c1ac36535e.tar.bz2
Improve constant folding of undef for cmp and select operators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134223 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstSimplify')
-rw-r--r--test/Transforms/InstSimplify/undef.ll (renamed from test/Transforms/InstSimplify/binop.ll)28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/Transforms/InstSimplify/binop.ll b/test/Transforms/InstSimplify/undef.ll
index f4bc557..8134cc8 100644
--- a/test/Transforms/InstSimplify/binop.ll
+++ b/test/Transforms/InstSimplify/undef.ll
@@ -97,3 +97,31 @@ define i64 @test13() {
%r = lshr i64 undef, undef
ret i64 %r
}
+
+; @test14
+; CHECK: ret i1 undef
+define i1 @test14() {
+ %r = icmp slt i64 undef, undef
+ ret i1 %r
+}
+
+; @test15
+; CHECK: ret i1 undef
+define i1 @test15() {
+ %r = icmp ult i64 undef, undef
+ ret i1 %r
+}
+
+; @test16
+; CHECK: ret i64 undef
+define i64 @test16(i64 %a) {
+ %r = select i1 undef, i64 %a, i64 undef
+ ret i64 %r
+}
+
+; @test17
+; CHECK: ret i64 undef
+define i64 @test17(i64 %a) {
+ %r = select i1 undef, i64 undef, i64 %a
+ ret i64 %r
+}