OpenCores
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] - Blame information for rev 801

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

Line No. Rev Author Line
1 693 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-Wswitch" } */
3
 
4
enum E { A, B, C, D, E, F };
5
 
6
int
7
f1 (enum E e)
8
{
9
  switch (e)
10
    {
11
    case A: return 1;
12
    case B: return 2;
13
    case C: return 3;
14
    case D: return 4;
15
    case E: return 5;
16
    case F: return 6;
17
    case 7: return 7;   /* { dg-warning "not in enumerated type" } */
18
    }
19
  return 0;
20
}
21
 
22
int
23
f2 (enum E e)
24
{
25
  switch (e)
26
    {
27
    case A: return 1;
28
    case B: return 2;
29
    case C: return 3;
30
    case D: return 4;
31
    case E: return 5;
32
    case F: return 6;
33
    case 7: return 7;   /* { dg-warning "not in enumerated type" } */
34
    default: return 8;
35
    }
36
  return 0;
37
}

powered by: WebSVN 2.1.0

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