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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 765 jeremybenn
/*--------------------------------------------------------------------------*/
2
/* File name  : err6.java                                              */
3
/*            :                                                             */
4
/* Cause      : Array evaluation order                                      */
5
/*            :                                                             */
6
/* Message    : NG:[1]-->[4]                                                */
7
/*            :                                                             */
8
/* Note       : JLS 15.9 Array Creation Expressions (p315--)                */
9
/*            :  p318 line3                                                 */
10
/*            :[Each dimension expression is fully evaluated                */
11
/*            : before any part of any dimension expression to its right.]  */
12
/*--------------------------------------------------------------------------*/
13
 
14
public class err6 {
15
  public static void main(String[] args) {
16
    int[] x = { 10, 11, 12, 1, 14 };
17
    int[] y = { 1, 2, 3, 4, 5, 6 };
18
 
19
    if ( x[(x=y)[2]] == 1 ) {
20
      System.out.println("OK");
21
    } else {
22
      System.out.println("NG:[1]-->[" +x[(x=y)[2]]+ "]");
23
    }
24
  }
25
}
26
 

powered by: WebSVN 2.1.0

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