OSDN Git Service

PR java/16789:
[pf3gnuchains/gcc-fork.git] / libjava / testsuite / libjava.lang / err12.java
1 /*--------------------------------------------------------------------------*/
2 /* File name : err12.java                                              */
3 /*            :                                                             */
4 /* Cause      : Cast negative floating point to char makes error            */
5 /*            :                                                             */
6 /* Message    : Internal compiler error in functi on convert_move           */
7 /*--------------------------------------------------------------------------*/
8
9 public class err12 {
10         public static void main(String[] args){
11                 char x1, x2;
12
13                 float y = -10000f;
14
15                 x1 = (char)y;           // err
16                 x2 = (char)-10000f;     // ok
17
18                 if ( x1 == x2 ) {
19                         System.out.println("OK");
20                 } else {
21                         System.out.println("NG");
22                         System.out.println("x1:[65520]-->[" +(x1-0)+"]");
23                         System.out.println("x2:[65520]-->[" +(x2-0)+"]");
24                 }
25         }
26 }
27