2 /* { dg-do compile } */
3 /* { dg-options "-Wtautological-compare" } */
10 if ((a
& 16) == 10) /* { dg-warning "bitwise comparison always evaluates to false" } */
12 if ((16 & a
) == 10) /* { dg-warning "bitwise comparison always evaluates to false" } */
14 if (10 == (a
& 16)) /* { dg-warning "bitwise comparison always evaluates to false" } */
16 if (10 == (16 & a
)) /* { dg-warning "bitwise comparison always evaluates to false" } */
19 if ((a
& 16) != 10) /* { dg-warning "bitwise comparison always evaluates to true" } */
21 if ((16 & a
) != 10) /* { dg-warning "bitwise comparison always evaluates to true" } */
23 if (10 != (a
& 16)) /* { dg-warning "bitwise comparison always evaluates to true" } */
25 if (10 != (16 & a
)) /* { dg-warning "bitwise comparison always evaluates to true" } */
46 if ((a
| 16) == 10) /* { dg-warning "bitwise comparison always evaluates to false" } */
48 if ((16 | a
) == 10) /* { dg-warning "bitwise comparison always evaluates to false" } */
50 if (10 == (a
| 16)) /* { dg-warning "bitwise comparison always evaluates to false" } */
52 if (10 == (16 | a
)) /* { dg-warning "bitwise comparison always evaluates to false" } */
55 if ((a
| 16) != 10) /* { dg-warning "bitwise comparison always evaluates to true" } */
57 if ((16 | a
) != 10) /* { dg-warning "bitwise comparison always evaluates to true" } */
59 if (10 != (a
| 16)) /* { dg-warning "bitwise comparison always evaluates to true" } */
61 if (10 != (16 | a
)) /* { dg-warning "bitwise comparison always evaluates to true" } */
64 if ((a
| 9) == 8) /* { dg-warning "bitwise comparison always evaluates to false" } */
66 if ((9 | a
) == 8) /* { dg-warning "bitwise comparison always evaluates to false" } */
68 if (8 == (a
| 9)) /* { dg-warning "bitwise comparison always evaluates to false" } */
70 if (8 == (9 | a
)) /* { dg-warning "bitwise comparison always evaluates to false" } */
73 if ((a
| 9) != 8) /* { dg-warning "bitwise comparison always evaluates to true" } */
75 if ((9 | a
) != 8) /* { dg-warning "bitwise comparison always evaluates to true" } */
77 if (8 != (a
| 9)) /* { dg-warning "bitwise comparison always evaluates to true" } */
79 if (8 != (9 | a
)) /* { dg-warning "bitwise comparison always evaluates to true" } */
82 if ((a
& 128) != 1) /* { dg-warning "bitwise comparison always evaluates to true" } */
84 if ((128 & a
) != 1) /* { dg-warning "bitwise comparison always evaluates to true" } */
86 if ((a
& FOO
) != 1) /* { dg-warning "bitwise comparison always evaluates to true" } */
88 if ((FOO
& a
) != 1) /* { dg-warning "bitwise comparison always evaluates to true" } */
90 if ((a
& 128) == 1) /* { dg-warning "bitwise comparison always evaluates to false" } */
92 if ((128 & a
) == 1) /* { dg-warning "bitwise comparison always evaluates to false" } */
94 if ((a
& FOO
) == 1) /* { dg-warning "bitwise comparison always evaluates to false" } */
96 if ((FOO
& a
) == 1) /* { dg-warning "bitwise comparison always evaluates to false" } */
100 if ((a
& N
) == 10) /* { dg-bogus "bitwise comparison always evaluates to false" "" { xfail *-*-* } } */
102 if ((a
| N
) == 10) /* { dg-bogus "bitwise comparison always evaluates to false" "" { xfail *-*-* } } */