1 ; This test makes sure that these instructions are properly eliminated.
4 ; RUN: as < %s | opt -instcombine | dis | not grep and
9 %B = and int %A, 0 ; zero result
14 %B = and int %A, -1 ; noop
18 bool %test3(bool %A) {
19 %B = and bool %A, false ; always = false
23 bool %test4(bool %A) {
24 %B = and bool %A, true ; noop
33 bool %test6(bool %A) {
38 int %test7(int %A) { ; A & ~A == 0
39 %NotA = xor int %A, -1
40 %B = and int %A, %NotA
44 ubyte %test8(ubyte %A) { ; AND associates
51 %B = and int %A, -2147483648 ; Test of sign bit, convert to setle %A, 0
52 %C = cast int %B to bool
56 bool %test9(uint %A) {
57 %B = and uint %A, 2147483648 ; Test of sign bit, convert to setle %A, 0
58 %C = cast uint %B to bool
62 uint %test10(uint %A) {
65 %D = and uint %C, 1 ; (X ^ C1) & C2 --> (X & C2) ^ (C1&C2)