Skip analyzer strndup test on hppa*-*-hpux*
[official-gcc.git] / gcc / testsuite / gcc.dg / Wint-in-bool-context-4.c
blob0e96dd7bd7c896f052e950437acc34cfd9d69f0f
1 /* PR c/102245 */
2 /* { dg-options "-Wint-in-bool-context" } */
3 /* { dg-do compile } */
5 _Bool test1(_Bool x)
7 return !(x << 0); /* { dg-warning "boolean context" } */
10 _Bool test2(_Bool x)
12 return !(x << 1); /* { dg-warning "boolean context" } */
15 _Bool test3(_Bool x, int y)
17 return !(x << y); /* { dg-warning "boolean context" } */
20 _Bool test4(int x, int y)
22 return !(x << y); /* { dg-warning "boolean context" } */
25 _Bool test5(int x, int y)
27 return !((x << y) << 0); /* { dg-warning "boolean context" } */
30 int test6(_Bool x)
32 int v = 0;
33 return (v & ~1L) | (1L & (x << 0)); /* { dg-bogus "boolean context" } */