mirror of
git://gcc.gnu.org/git/gcc.git
synced 2024-12-19 17:19:48 +08:00
f160279bf8
* libjava.lang/test.exp: New file. * libjava.lang/err9.out: New file. * libjava.lang/err9.java: New file. * libjava.lang/err8.out: New file. * libjava.lang/err8.java: New file. * libjava.lang/err7.out: New file. * libjava.lang/err7.java: New file. * libjava.lang/err6.out: New file. * libjava.lang/err6.java: New file. * libjava.lang/err5.out: New file. * libjava.lang/err5.java: New file. * libjava.lang/err4.out: New file. * libjava.lang/err4.java: New file. * libjava.lang/err3.out: New file. * libjava.lang/err3.java: New file. * libjava.lang/err2.out: New file. * libjava.lang/err2.java: New file. * libjava.lang/err13.out: New file. * libjava.lang/err13.java: New file. * libjava.lang/err12.out: New file. * libjava.lang/err12.java: New file. * libjava.lang/err11.out: New file. * libjava.lang/err11.java: New file. * libjava.lang/err10.out: New file. * libjava.lang/err10.java: New file. * libjava.lang/err1.out: New file. * libjava.lang/err1.java: New file. * libjava.lang/N19990310_5.out: New file. * libjava.lang/N19990310_5.java: New file. * libjava.lang/N19990310_4.out: New file. * libjava.lang/N19990310_4.java: New file. * libjava.lang/N19990310_3.out: New file. * libjava.lang/N19990310_3.java: New file. * libjava.lang/N19990310_02.out: New file. * libjava.lang/N19990310_02.java: New file. * libjava.lang/G19990303_02.out: New file. * libjava.lang/G19990303_02.java: New file. * libjava.lang/G19990303_01.out: New file. * libjava.lang/G19990303_01.java: New file. * libjava.lang/G19990302_02.out: New file. * libjava.lang/G19990302_02.java: New file. * libjava.lang/G19990301_01.out: New file. * libjava.lang/G19990301_01.java: New file. * libjava.compile/N19990317.java: New file. * libjava.compile/N19990310_01.java: New file. * libjava.compile/G19990225_01.java: New file. * libjava.compile/G19990217_02.java: New file. * libjava.compile/G19990217_01.java: New file. * libjava.compile/G19990210_3.java: New file. * libjava.compile/G19990210_2.java: New file. * libjava.compile/G19990210_1.java: New file. From-SVN: r28087
36 lines
1.6 KiB
Java
36 lines
1.6 KiB
Java
/*--------------------------------------------------------------------------*/
|
|
/* file_name : err5.java */
|
|
/* : */
|
|
/* Cause : Evaluation order of method argument is not correct. */
|
|
/* : */
|
|
/* Message : NG */
|
|
/* : a:[1]-->[2] */
|
|
/* : b:[3]-->[3] */
|
|
/* : c:[2]-->[2] */
|
|
/* : */
|
|
/* Note : JLS 15.6 Evaluation Order */
|
|
/* S15.6.4 Argument Lists are Evaluated Left-to-Right(p309) */
|
|
/* [Each argument expression appears to be fully evaluated */
|
|
/* before any part of any argument expression to its right.] */
|
|
/*--------------------------------------------------------------------------*/
|
|
|
|
public class err5 {
|
|
public static void main(String[] args) {
|
|
int x = 1;
|
|
|
|
err5 obj = new err5();
|
|
obj.print(x, x = 3, x = 2);
|
|
}
|
|
|
|
void print(int a, int b, int c) {
|
|
if ( a == 1 && b == 3 && c == 2 ) {
|
|
System.out.println("OK");
|
|
} else {
|
|
System.out.println("NG");
|
|
System.out.println("a:[1]-->["+a+"]");
|
|
System.out.println("b:[3]-->["+b+"]");
|
|
System.out.println("c:[2]-->["+c+"]");
|
|
}
|
|
}
|
|
}
|