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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [nested-func-1.c] - Blame information for rev 816

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

Line No. Rev Author Line
1 298 jeremybenn
/* Test for proper errors for break and continue in nested functions.  */
2
/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
3
/* { dg-do compile } */
4
/* { dg-options "" } */
5
 
6
void
7
foo (int a)
8
{
9
  switch (a) {
10
    void bar1 (void) { break; } /* { dg-error "break statement" "break switch 1" } */
11
  }
12
  switch (a) {
13
  case 0:
14
    (void) 0;
15
    void bar2 (void) { break; } /* { dg-error "break statement" "break switch 2" } */
16
  }
17
  while (1) {
18
    void bar3 (void) { break; } /* { dg-error "break statement" "break while" } */
19
  }
20
  do {
21
    void bar4 (void) { break; } /* { dg-error "break statement" "break do" } */
22
  } while (1);
23
  for (;;) {
24
    void bar5 (void) { break; } /* { dg-error "break statement" "break for" } */
25
  }
26
  while (1) {
27
    void bar6 (void) { continue; } /* { dg-error "continue statement" "continue while" } */
28
  }
29
  do {
30
    void bar7 (void) { continue; } /* { dg-error "continue statement" "continue do" } */
31
  } while (1);
32
  for (;;) {
33
    void bar8 (void) { continue; } /* { dg-error "continue statement" "continue for" } */
34
  }
35
}

powered by: WebSVN 2.1.0

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