URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [warn/] [Wswitch-3.C] - Rev 694
Go to most recent revision | Compare with Previous | Blame | View Log
/* { dg-do compile } */
/* { dg-options "-Wswitch" } */
enum E { A, B, C, D, E, F };
int
f1 (enum E e)
{
switch (e)
{
case A: return 1;
case B: return 2;
case C: return 3;
case D: return 4;
case E: return 5;
case F: return 6;
case 7: return 7; /* { dg-warning "not in enumerated type" } */
}
return 0;
}
int
f2 (enum E e)
{
switch (e)
{
case A: return 1;
case B: return 2;
case C: return 3;
case D: return 4;
case E: return 5;
case F: return 6;
case 7: return 7; /* { dg-warning "not in enumerated type" } */
default: return 8;
}
return 0;
}
Go to most recent revision | Compare with Previous | Blame | View Log