OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [opt/] [enum2.C] - Blame information for rev 693

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// PR c++/43680
2
// Test that we don't make excessively aggressive assumptions about what
3
// values an enum variable can have.
4
// { dg-options "-O2 -fPIC" }
5
// { dg-do run }
6
 
7
extern "C" void abort ();
8
 
9
enum E { A, B, C, D };
10
 
11
void
12
CheckE(const E value)
13
{
14
  long v = value;
15
  if (v <= D)
16
    abort ();
17
}
18
 
19
int main() {
20
  CheckE(static_cast(5));
21
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.