1 /* Test for a bogus warning on comparison between signed and unsigned.
2 Origin: Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 8/21/2001. */
4 /* { dg-do compile } */
5 /* { dg-options "-Wsign-compare" } */
9 int foo(int x
, int y
, unsigned u
)
11 /* A *_DIV_EXPR is non-negative if both operands are. */
13 if (u
< ((x
=-22)/33)) /* { dg-warning "signed and unsigned" "DIV_EXPR" } */
19 if (u
< ((x
=22)/(y
=33)))
22 if (u
< (((x
&0x10000)?128:64) / ((y
&0x10000)?8:4)))
26 /* A *_MOD_EXPR is non-negative if the first operand is. */
28 if (u
< ((x
=-22)%33)) /* { dg-warning "signed and unsigned" "MOD_EXPR" } */
37 if (u
< (((x
=22)/33)%-33))