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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.dg/] [opt/] [switch4.C] - Blame information for rev 856

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

Line No. Rev Author Line
1 149 jeremybenn
// { dg-do compile }
2
 
3
// PR c++/20008
4
 
5
// We failed to compile this because CFG cleanup left the switch
6
// statement intact, whereas expand_case expected at least one
7
// in-range case to remain.
8
 
9
typedef enum _SECStatus {
10
  SECWouldBlock = -2,
11
  SECFailure = -1,
12
  SECSuccess = 0
13
} SECStatus;
14
 
15
typedef enum {
16
  SEC_ERROR_BAD_SIGNATURE = (-0x2000) + 10
17
} SECErrorCodes;
18
 
19
void g(void);
20
void f(SECStatus status)
21
{
22
  switch( status )
23
    {
24
    case SEC_ERROR_BAD_SIGNATURE :
25
      // This case can be optimized away in C++ (but apparently not in
26
      // C), because the enum type is defined with a narrow range.
27
      g();
28
      break ;
29
    }
30
}

powered by: WebSVN 2.1.0

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