OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [c99-vla-jump-5.c] - Blame information for rev 405

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

Line No. Rev Author Line
1 149 jeremybenn
/* Test for labels and VM declarations: bug 12913.
2
   switch statements must not jump into the scope of VM declarations.
3
 
4
   c99-vla-jump-1.c tests with just that label and goto, VLAs.
5
   c99-vla-jump-2.c tests with many other labels and gotos, VLAs.
6
   c99-vla-jump-3.c tests with just that label and goto, VM.
7
   c99-vla-jump-4.c tests with many other labels and gotos, VM.
8
   c99-vla-jump-5.c tests with switch statements.  */
9
 
10
/* Origin: Joseph Myers <joseph@codesourcery.com> */
11
/* { dg-do compile } */
12
/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
13
 
14
void
15
f (int a, int b)
16
{
17
  switch (a) {
18
    int v[b];
19
  case 2: /* { dg-error "error: case label in scope of identifier with variably modified type not containing enclosing switch statement" } */
20
  default: /* { dg-error "error: 'default' label in scope of identifier with variably modified type not containing enclosing switch statement" } */
21
  switch (a)
22
    {
23
    case 4:
24
      { int z[b]; }
25
    default:
26
      ;
27
      int w[b];
28
    }
29
  }
30
}

powered by: WebSVN 2.1.0

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