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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libjava/] [testsuite/] [libjava.lang/] [err9.java] - Blame information for rev 765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 765 jeremybenn
/*--------------------------------------------------------------------------*/
2
/* File name  : err9.java                                              */
3
/*            :                                                             */
4
/* Cause      : When I use "labeled continue" in "for"statement, error      */
5
/*            :                                                             */
6
/* Message    :  In class `err9':                                      */
7
/*            :  In method `main(java.lang.String[])':                      */
8
/*            : 22: `continue' must be in loop.                             */
9
/*            :                 continue  movehere;                         */
10
/*            :                 ^                                           */
11
/*            : 1 error                                                     */
12
/*--------------------------------------------------------------------------*/
13
 
14
public class err9 {
15
  public static void main(String[] args) {
16
    int y = 0;
17
 
18
  movehere: for ( int x = 0; x < 10; x++ ) {
19
    if ( x > 2 ) {
20
      continue  movehere;
21
    }
22
    y++;
23
  }
24
 
25
  if ( y == 3 ) {
26
    System.out.println("OK");
27
  } else {
28
    System.out.println("NG:[3]-->[" +y+ "]");
29
  }
30
  }
31
}
32
 

powered by: WebSVN 2.1.0

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