1 /* Test for a bogus warning on comparison between signed and unsigned.
2 This was inspired by code in gcc. This testcase is identical to
3 compare9.c except that we use -fno-short-enums here and expect a
4 warning from case 4. */
6 /* { dg-do compile } */
7 /* { dg-options "-fno-short-enums -Wsign-compare" } */
11 /* This enumeration has an explicit negative value and is therefore signed. */
14 VOID, SI, DI, MAX = -1
17 /* This enumeration fits entirely in a signed int, but is unsigned anyway. */
25 return x == (tf?DI:SI); /* { dg-bogus "signed and unsigned" "case 1" } */
30 return x == (tf?DI:-1); /* { dg-bogus "signed and unsigned" "case 2" } */
35 return x == (tf?DI2:SI2); /* { dg-bogus "signed and unsigned" "case 3" } */
40 return x == (tf?DI2:-1); /* { dg-warning "signed and unsigned" "case 4" } */