gcc/testsuite/c-c++-common/pr51712.c
raw| 1 | /* PR c/51712 */ |
| 2 | /* { dg-do compile } */ |
| 3 | /* { dg-options "-Wtype-limits" } */ |
| 4 | /* { dg-additional-options "-fno-short-enums" { target short_enums } } */ |
| 5 | |
| 6 | enum test_enum { |
| 7 | FOO, |
| 8 | BAR |
| 9 | }; |
| 10 | |
| 11 | int valid(enum test_enum arg) |
| 12 | { |
| 13 | return arg >= 0 && arg <= BAR; |
| 14 | } |
| 15 | |
| 16 | int valid2(unsigned int arg2) |
| 17 | { |
| 18 | return arg2 >= FOO && arg2 <= BAR; /* { dg-bogus "comparison of unsigned expression" "" { xfail c } } */ |
| 19 | } |