1 ; This test makes sure that these instructions are properly eliminated.
4 ; RUN: as < %s | opt -instcombine | dis | grep -v xor | not grep 'or '
18 ubyte %test2a(ubyte %A) {
23 bool %test3(bool %A) {
24 %B = or bool %A, false
28 bool %test4(bool %A) {
33 bool %test9(bool %A) {
43 int %test12(int %A) { ; A | ~A == -1
44 %NotA = xor int -1, %A
49 ubyte %test14(ubyte %A) {
55 ubyte %test17(ubyte %A, ubyte %B) { ; Test that (A|c1)|(B|c2) == (A|B)|(c1|c2)
62 ubyte %test21(ubyte %A) {
64 %C = and ubyte %B, 254
65 %D = or ubyte %C, 254 ; (X & C1) | C2 --> (X | C2) & (C1|C2)
69 ubyte %test22(ubyte %A) {
72 %D = or ubyte %C, 1 ; (X ^ C1) | C2 --> (X | C2) ^ (C1&~C2)
77 uint %test23(uint %A) {
78 %B = or uint %A, 4 ; Should be eliminated
83 uint %test24(uint %A) {
85 %C = and uint %B, 8 ; Always equal to 8