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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [stmt-expr-label-2.c] - Blame information for rev 867

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

Line No. Rev Author Line
1 149 jeremybenn
/* Test for labels in statement expressions: bugs 772 and 17913.
2
   switch statements must not jump into statement expressions.  */
3
 
4
/* Origin: Joseph Myers <joseph@codesourcery.com> */
5
/* { dg-do compile } */
6
/* { dg-options "" } */
7
 
8
void
9
f (int a)
10
{
11
  switch (a)
12
    {
13
    case 0:
14
    case 1:
15
      ({
16
      case 2: /* { dg-error "error: case label in statement expression not containing enclosing switch statement" } */
17
      default: /* { dg-error "error: 'default' label in statement expression not containing enclosing switch statement" } */
18
        switch (a)
19
          {
20
          case 3:
21
          default:
22
            ;
23
          }
24
        0;
25
      });
26
    }
27
}

powered by: WebSVN 2.1.0

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