summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/torture/20100825.C
blob: 460c1b608753f137557dbe489433f1e72144887e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// { dg-do run }

typedef enum { zero = 0, one = 1, two = 2, ENUM_MAX = 3 } my_enum;
my_enum e;
extern "C" void abort (void);
int __attribute__((noinline)) foo() { return 10; }
int main()
{
  int r;
  r = foo();
  if ((r < 0) || (r >= ENUM_MAX))
    return 0;
  e = (my_enum)r;
  abort ();
}