1 /* Test for a bogus warning on comparison between signed and unsigned.
2 This was inspired by code in gcc. */
4 /* { dg-do compile } */
5 /* { dg-options "-Wsign-compare" } */
9 /* This enumeration has an explicit negative value and is therefore signed. */
12 VOID, SI, DI, MAX = -1
15 /* This enumeration fits entirely in a signed int, but is unsigned anyway. */
23 return x == (tf?DI:SI); /* { dg-bogus "signed and unsigned" "case 1" } */
28 return x == (tf?DI:-1); /* { dg-bogus "signed and unsigned" "case 2" } */
33 return x == (tf?DI2:SI2); /* { dg-bogus "signed and unsigned" "case 3" } */
38 return x == (tf?DI2:-1); /* { dg-warning "signed and unsigned" "case 4" } */