aboutsummaryrefslogtreecommitdiff
path: root/libjava/testsuite/libjava.lang/err4.java
blob: ad908e27531df38b7c8e778c036a71d30326f8a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*--------------------------------------------------------------------------*/
/* file_name  : err4.java                                              */
/*            :                                                             */
/* Cause      : Evaluation of the array which used the substitution         */
/*            : operator is not performed correctly.                        */
/*            :                                                             */
/* Message    : NG1:[27}-->[9.0]                                            */
/*            : NG1:[27}-->[9.0]                                            */
/*--------------------------------------------------------------------------*/

public class err4 {
  public static void main(String[] args) {

    // TEST1
    float []a = {9f};
    a[0] *= (a[0] = 3f);

    if ( a[0] == 27 ) {
      System.out.println("OK1");
    } else {
      System.out.println("NG1:[27}-->["+a[0]+"]");
    }

    //TEST2
    float [] b = {9f};
    b[0] = (float)(b[0] * (b[0] = 3f));
    if ( b[0] == 27 ) {
      System.out.println("OK1");
    } else {
      System.out.println("NG1:[27}-->["+b[0]+"]");
    }
  }
}