aboutsummaryrefslogtreecommitdiff
path: root/test/Transforms/InstSimplify/compare.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/Transforms/InstSimplify/compare.ll')
-rw-r--r--test/Transforms/InstSimplify/compare.ll18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/Transforms/InstSimplify/compare.ll b/test/Transforms/InstSimplify/compare.ll
index 44c678c6f1..11295b7072 100644
--- a/test/Transforms/InstSimplify/compare.ll
+++ b/test/Transforms/InstSimplify/compare.ll
@@ -236,6 +236,15 @@ define i1 @urem4(i32 %X) {
; CHECK: ret i1 %B
}
+define i1 @urem5(i16 %X, i32 %Y) {
+; CHECK: @urem5
+ %A = zext i16 %X to i32
+ %B = urem i32 %A, %Y
+ %C = icmp slt i32 %B, %Y
+ ret i1 %C
+; CHECK: ret i1 true
+}
+
define i1 @srem1(i32 %X) {
; CHECK: @srem1
%A = srem i32 %X, -5
@@ -244,6 +253,15 @@ define i1 @srem1(i32 %X) {
; CHECK: ret i1 false
}
+define i1 @srem2(i32 %X, i32 %Y) {
+; CHECK: @srem2
+ %neg = sub i32 %Y, 0
+ %A = srem i32 %X, %Y
+ %B = icmp slt i32 %A, %neg
+ ret i1 %B
+; CHECK: ret i1 true
+}
+
define i1 @udiv1(i32 %X) {
; CHECK: @udiv1
%A = udiv i32 %X, 1000000