PR tree-optimization/83369 - Missing diagnostics during inlining
[official-gcc.git] / gcc / testsuite / gcc.dg / compare9.c
blobfba61e42a48ea2ee26bf5dd2cec4806703c3fa9a
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 compare1.c except that we use -fshort-enums here and do not expect
4 a warning from case 4. */
6 /* { dg-do compile } */
7 /* { dg-options "-fshort-enums -Wsign-compare" } */
9 int tf = 1;
11 /* This enumeration has an explicit negative value and is therefore signed. */
12 enum mm1
14 VOID, SI, DI, MAX = -1
17 /* This enumeration fits entirely in a signed int, but is unsigned anyway. */
18 enum mm2
20 VOID2, SI2, DI2, MAX2
23 int f(enum mm1 x)
25 return x == (tf?DI:SI); /* { dg-bogus "changes signedness" "case 1" } */
28 int g(enum mm1 x)
30 return x == (tf?DI:-1); /* { dg-bogus "changes signedness" "case 2" } */
33 int h(enum mm2 x)
35 return x == (tf?DI2:SI2); /* { dg-bogus "changes signedness" "case 3" } */
38 int i(enum mm2 x)
40 return x == (tf?DI2:-1); /* { dg-bogus "changes signedness" "case 4" } */