view gcc/testsuite/c-c++-common/pr51712.c @ 140:4e440907fcbf

copy CbC goto flang in cfgexpand remove some CbC unnecessary code
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Wed, 14 Nov 2018 00:24:45 +0900
parents 04ced10e8804
children 1830386684a0
line wrap: on
line source

/* 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 *-*-* } } */
}