3 { dg-options "-Wlogical-op" }
8 enum testenum
{ t1
, t2
};
11 extern char bool_a
, bool_b
;
17 if ( testa() && b
) /* { dg-warning "logical" } */
20 if ( c
&& b
) /* { dg-warning "logical" } */
23 if ( c
&& 0x42 ) /* { dg-warning "logical" } */
26 if ( c
&& 0x80 >>6) /* { dg-warning "logical" } */
30 if ( b
&& c
== a
) /* { dg-bogus "logical" } */
33 if ( 1 && c
) /* { dg-bogus "logical" } */
36 if ( t2
&& b
) /* { dg-bogus "logical" } */
39 if ( 0 && c
== a
) /* { dg-bogus "logical" } */
42 if ( b
&& 1 ) /* { dg-bogus "logical" } */
49 if ( testa() || b
) /* { dg-warning "logical" } */
52 if ( c
|| b
) /* { dg-warning "logical" } */
55 if ( c
|| 0x42 ) /* { dg-warning "logical" } */
58 if ( c
|| 0x80 >>6) /* { dg-warning "logical" } */
62 if ( b
|| c
== a
) /* { dg-bogus "logical" } */
65 if ( 1 || c
) /* { dg-bogus "logical" } */
68 if ( t2
|| b
) /* { dg-bogus "logical" } */
71 if ( 0 || c
== a
) /* { dg-bogus "logical" } */
74 if ( b
|| 1 ) /* { dg-bogus "logical" } */