summaryrefslogtreecommitdiff
path: root/test/Transforms/InstSimplify
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2011-01-25 15:14:15 +0000
committerDuncan Sands <baldrick@free.fr>2011-01-25 15:14:15 +0000
commit227fba11ca168225d913d1cea94a05b883092e76 (patch)
treed6136703e166796c5838748f745ad92d120fe0be /test/Transforms/InstSimplify
parentafde5188f2a97bd776e1349fe78801d67e187136 (diff)
downloadllvm-227fba11ca168225d913d1cea94a05b883092e76.tar.gz
llvm-227fba11ca168225d913d1cea94a05b883092e76.tar.bz2
llvm-227fba11ca168225d913d1cea94a05b883092e76.tar.xz
In which I discover that zero+zero is zero, d'oh!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124188 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstSimplify')
-rw-r--r--test/Transforms/InstSimplify/2011-01-18-Compare.ll15
1 files changed, 14 insertions, 1 deletions
diff --git a/test/Transforms/InstSimplify/2011-01-18-Compare.ll b/test/Transforms/InstSimplify/2011-01-18-Compare.ll
index 705f354249..c905c443d2 100644
--- a/test/Transforms/InstSimplify/2011-01-18-Compare.ll
+++ b/test/Transforms/InstSimplify/2011-01-18-Compare.ll
@@ -61,11 +61,14 @@ define i1 @sext3() {
}
define i1 @add(i32 %x, i32 %y) {
+; CHECK: @add
%l = lshr i32 %x, 1
- %r = lshr i32 %y, 1
+ %q = lshr i32 %y, 1
+ %r = or i32 %q, 1
%s = add i32 %l, %r
%c = icmp eq i32 %s, 0
ret i1 %c
+; CHECK: ret i1 false
}
define i1 @add2(i8 %x, i8 %y) {
@@ -78,6 +81,16 @@ define i1 @add2(i8 %x, i8 %y) {
; CHECK: ret i1 false
}
+define i1 @add3(i8 %x, i8 %y) {
+; CHECK: @add3
+ %l = zext i8 %x to i32
+ %r = zext i8 %y to i32
+ %s = add i32 %l, %r
+ %c = icmp eq i32 %s, 0
+ ret i1 %c
+; CHECK: ret i1 %c
+}
+
define i1 @addpowtwo(i32 %x, i32 %y) {
; CHECK: @addpowtwo
%l = lshr i32 %x, 1