aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/InstSimplify/2011-01-18-Compare.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/Transforms/InstSimplify/2011-01-18-Compare.ll')
-rw-r--r--test/Transforms/InstSimplify/2011-01-18-Compare.ll54
1 files changed, 54 insertions, 0 deletions
diff --git a/test/Transforms/InstSimplify/2011-01-18-Compare.ll b/test/Transforms/InstSimplify/2011-01-18-Compare.ll
index 1279579..78e225a 100644
--- a/test/Transforms/InstSimplify/2011-01-18-Compare.ll
+++ b/test/Transforms/InstSimplify/2011-01-18-Compare.ll
@@ -27,6 +27,14 @@ define i1 @zext2(i1 %x) {
; CHECK: ret i1 %x
}
+define i1 @zext3() {
+; CHECK: @zext3
+ %e = zext i1 1 to i32
+ %c = icmp ne i32 %e, 0
+ ret i1 %c
+; CHECK: ret i1 true
+}
+
define i1 @sext(i32 %x) {
; CHECK: @sext
%e1 = sext i32 %x to i64
@@ -43,3 +51,49 @@ define i1 @sext2(i1 %x) {
ret i1 %c
; CHECK: ret i1 %x
}
+
+define i1 @sext3() {
+; CHECK: @sext3
+ %e = sext i1 1 to i32
+ %c = icmp ne i32 %e, 0
+ ret i1 %c
+; CHECK: ret i1 true
+}
+
+define i1 @add(i32 %x, i32 %y) {
+; CHECK: @add
+ %l = lshr i32 %x, 1
+ %r = lshr i32 %y, 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) {
+; CHECK: @add2
+ %l = or i8 %x, 128
+ %r = or i8 %y, 129
+ %s = add i8 %l, %r
+ %c = icmp eq i8 %s, 0
+ ret i1 %c
+; CHECK: ret i1 false
+}
+
+define i1 @addpowtwo(i32 %x, i32 %y) {
+; CHECK: @addpowtwo
+ %l = lshr i32 %x, 1
+ %r = shl i32 1, %y
+ %s = add i32 %l, %r
+ %c = icmp eq i32 %s, 0
+ ret i1 %c
+; CHECK: ret i1 false
+}
+
+define i1 @or(i32 %x) {
+; CHECK: @or
+ %o = or i32 %x, 1
+ %c = icmp eq i32 %o, 0
+ ret i1 %c
+; CHECK: ret i1 false
+}