OSDN Git Service

PR libgcj/12656:
[pf3gnuchains/gcc-fork.git] / libjava / testsuite / libjava.lang / err4.java
1 /*--------------------------------------------------------------------------*/
2 /* file_name  : err4.java                                              */
3 /*            :                                                             */
4 /* Cause      : Evaluation of the array which used the substitution         */
5 /*            : operator is not performed correctly.                        */
6 /*            :                                                             */
7 /* Message    : NG1:[27}-->[9.0]                                            */
8 /*            : NG1:[27}-->[9.0]                                            */
9 /*--------------------------------------------------------------------------*/
10
11 public class err4 {
12   public static void main(String[] args) {
13
14     // TEST1
15     float []a = {9f};
16     a[0] *= (a[0] = 3f);
17
18     if ( a[0] == 27 ) {
19       System.out.println("OK1");
20     } else {
21       System.out.println("NG1:[27}-->["+a[0]+"]");
22     }
23
24     //TEST2
25     float [] b = {9f};
26     b[0] = (float)(b[0] * (b[0] = 3f));
27     if ( b[0] == 27 ) {
28       System.out.println("OK1");
29     } else {
30       System.out.println("NG1:[27}-->["+b[0]+"]");
31     }
32   }
33 }
34