xref: /aosp_15_r20/external/llvm/test/Transforms/InstCombine/2008-05-31-Bools.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: opt < %s -instcombine -S > %t
2*9880d681SAndroid Build Coastguard Worker; RUN: grep "xor" %t
3*9880d681SAndroid Build Coastguard Worker; RUN: grep "and" %t
4*9880d681SAndroid Build Coastguard Worker; RUN: not grep "div" %t
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard Workerdefine i1 @foo1(i1 %a, i1 %b) {
7*9880d681SAndroid Build Coastguard Worker  %A = sub i1 %a, %b
8*9880d681SAndroid Build Coastguard Worker  ret i1 %A
9*9880d681SAndroid Build Coastguard Worker}
10*9880d681SAndroid Build Coastguard Worker
11*9880d681SAndroid Build Coastguard Workerdefine i1 @foo2(i1 %a, i1 %b) {
12*9880d681SAndroid Build Coastguard Worker  %A = mul i1 %a, %b
13*9880d681SAndroid Build Coastguard Worker  ret i1 %A
14*9880d681SAndroid Build Coastguard Worker}
15*9880d681SAndroid Build Coastguard Worker
16*9880d681SAndroid Build Coastguard Workerdefine i1 @foo3(i1 %a, i1 %b) {
17*9880d681SAndroid Build Coastguard Worker  %A = udiv i1 %a, %b
18*9880d681SAndroid Build Coastguard Worker  ret i1 %A
19*9880d681SAndroid Build Coastguard Worker}
20*9880d681SAndroid Build Coastguard Worker
21*9880d681SAndroid Build Coastguard Workerdefine i1 @foo4(i1 %a, i1 %b) {
22*9880d681SAndroid Build Coastguard Worker  %A = sdiv i1 %a, %b
23*9880d681SAndroid Build Coastguard Worker  ret i1 %A
24*9880d681SAndroid Build Coastguard Worker}
25