xref: /minix3/external/bsd/llvm/dist/llvm/test/Transforms/InstSimplify/rem.ll (revision 0b98e8aad89f2bd4ba80b523d73cf29e9dd82ce1)
1; RUN: opt < %s -instsimplify -S | FileCheck %s
2
3define i32 @select1(i32 %x, i1 %b) {
4; CHECK-LABEL: @select1(
5  %rhs = select i1 %b, i32 %x, i32 1
6  %rem = srem i32 %x, %rhs
7  ret i32 %rem
8; CHECK: ret i32 0
9}
10
11define i32 @select2(i32 %x, i1 %b) {
12; CHECK-LABEL: @select2(
13  %rhs = select i1 %b, i32 %x, i32 1
14  %rem = urem i32 %x, %rhs
15  ret i32 %rem
16; CHECK: ret i32 0
17}
18