Document gcov-io (PR gcov-profile/84735).
[official-gcc.git] / gcc / testsuite / gcc.dg / compare5.c
blob3a502f12de9a3aafcbc95701732d4dff374be601
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" } */
7 extern void bar(void);
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 "different signedness" "DIV_EXPR" } */
14 return x;
16 if (u < ((x=22)/33))
17 return x;
19 if (u < ((x=22)/(y=33)))
20 return x;
22 if (u < (((x&0x10000)?128:64) / ((y&0x10000)?8:4)))
23 return x;
26 /* A *_MOD_EXPR is non-negative if the first operand is. */
28 if (u < ((x=-22)%33)) /* { dg-warning "different signedness" "MOD_EXPR" } */
29 return x;
31 if (u < ((x=22)%-33))
32 return x;
34 if (u < ((x==y)%-33))
35 return x;
37 if (u < (((x=22)/33)%-33))
38 return x;
40 return 0;