err12.java 907 Bytes
Newer Older
Tom Tromey committed
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
/*--------------------------------------------------------------------------*/
/* File name : err12.java                                              */
/*            :                                                             */
/* Cause      : Cast negative floating point to char makes error            */
/*            :                                                             */
/* Message    : Internal compiler error in functi on convert_move           */
/*--------------------------------------------------------------------------*/

public class err12 {
	public static void main(String[] args){
		char x1, x2;

		float y = -10000f;

		x1 = (char)y;		// err
		x2 = (char)-10000f;	// ok

		if ( x1 == x2 ) {
			System.out.println("OK");
		} else {
			System.out.println("NG");
			System.out.println("x1:[65520]-->[" +(x1-0)+"]");
			System.out.println("x2:[65520]-->[" +(x2-0)+"]");
		}
	}
}