1 ; This test makes sure that these instructions are properly eliminated.
4 ; RUN: as < %s | opt -instcombine | dis | not grep 'xor '
9 %B = xor bool %A, false
18 bool %test2(bool %A) {
28 int %test4(int %A) { ; A ^ ~A == -1
29 %NotA = xor int -1, %A
30 %B = xor int %A, %NotA
34 uint %test5(uint %A) { ; (A|B)^B == A & (~B)
36 %r = xor uint %t1, 123
40 ubyte %test6(ubyte %A) {
46 ; (A & C1)^(B & C2) -> (A & C1)|(B & C2) iff C1&C2 == 0
47 int %test7(int %A, int %B) {
51 %C1 = xor int %A1, %B1
55 ubyte %test8(bool %c) {
56 %d = xor bool %c, true ; invert the condition
57 br bool %d, label %True, label %False
64 bool %test9(ubyte %A) {
65 %B = xor ubyte %A, 123 ; xor can be eliminated
66 %C = seteq ubyte %B, 34
70 ubyte %test10(ubyte %A) {
72 %C = xor ubyte %B, 4 ; transform into an OR
76 ubyte %test11(ubyte %A) {
78 %C = xor ubyte %B, 4 ; transform into an AND