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] - Rev 693

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;
}

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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