1 /* { dg-options "-Wint-in-bool-context" } */
2 /* { dg-do compile } */
3
4 typedef unsigned u32;
5 typedef unsigned char u8;
6 #define KEYLENGTH 8
7
8 int foo (u8 plen, u32 key)
9 {
10 if ((plen < KEYLENGTH) && (key << plen)) /* { dg-bogus "boolean context" } */
11 return -1;
12
13 if ((plen << KEYLENGTH) && (key < plen)) /* { dg-warning "boolean context" } */
14 return -2;
15
16 return 0;
17 }