Fix ICE in substring-handling building 502.gcc_r (PR 87562)
[official-gcc.git] / gcc / testsuite / c-c++-common / Wlogical-not-parentheses-3.c
blob00aa747652bc08aa64c00cae8a8ece572e9d2d5b
1 /* PR c/77423 */
2 /* { dg-do compile } */
3 /* { dg-options "-Wlogical-not-parentheses" } */
5 #ifndef __cplusplus
6 # define bool _Bool
7 #endif
9 int
10 f (int a, bool b, bool c)
12 int r = 0;
14 r += !a == (b | c);
15 r += !a == (b ^ c);
16 r += !a == (b & c);
17 r += !a == ~b;
18 r += !a == ~(int) b;
19 r += !a == ((b & c) | c);
20 r += !a == ((b & c) | (b ^ c));
21 r += !a == (int) (b ^ c);
22 r += !a == (int) ~b;
23 r += !a == ~~b;
24 r += !a == ~(b | c);
25 r += !a == ~(b | (a == 1));
26 r += !a == ~(a == 1);
28 r += !a == ((b & c) | (b ^ a)); /* { dg-warning "logical not is only applied to the left hand side of comparison" } */
30 return r;