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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.dg/] [tc1/] [dr128.C] - Blame information for rev 825

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
// { dg-do run }
2
// Origin: Giovanni Bajo 
3
// DR128: Casting between enum types
4
 
5
extern "C" void abort(void);
6
 
7
enum E1 { BLACK = 0, RED = 1 };
8
enum E2 { WHITE = 0, YELLOW = 1};
9
 
10
int main(void)
11
{
12
  E1 e1 = RED;
13
  E2 e2 = static_cast(e1);
14
  if (e2 != YELLOW)
15
    abort();
16
  return 0;
17
}

powered by: WebSVN 2.1.0

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