diff options
Diffstat (limited to 'gcc-4.9/gcc/testsuite/c-c++-common/pr51712.c')
-rw-r--r-- | gcc-4.9/gcc/testsuite/c-c++-common/pr51712.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/c-c++-common/pr51712.c b/gcc-4.9/gcc/testsuite/c-c++-common/pr51712.c new file mode 100644 index 000000000..69e316d24 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/c-c++-common/pr51712.c @@ -0,0 +1,19 @@ +/* PR c/51712 */ +/* { dg-do compile } */ +/* { dg-options "-Wtype-limits" } */ +/* { dg-additional-options "-fno-short-enums" { target short_enums } } */ + +enum test_enum { + FOO, + BAR +}; + +int valid(enum test_enum arg) +{ + return arg >= 0 && arg <= BAR; +} + +int valid2(unsigned int arg2) +{ + return arg2 >= FOO && arg2 <= BAR; /* { dg-bogus "comparison of unsigned expression" "" { xfail *-*-* } } */ +} |