langtools/test/tools/javac/unicode/NonasciiDigit.java
changeset 25600 7f93cb0536fd
parent 25439 26d6d07eebc7
equal deleted inserted replaced
25456:39cfdc2dcaf3 25600:7f93cb0536fd
     1 /*
     1 /*
     2  * @test /nodynamiccopyright/
     2  * @test /nodynamiccopyright/
     3  * @bug 4707960 6183529
     3  * @bug 4707960 6183529 8046620
     4  * @summary javac accepts unicode digits - sometimes crashing
     4  * @summary javac accepts unicode digits - sometimes crashing
     5  * @author gafter
     5  * @author gafter
     6  *
     6  *
     7  * @compile/fail/ref=NonasciiDigit.out -XDrawDiagnostics  NonasciiDigit.java
     7  * @compile/fail/ref=NonasciiDigit.out -XDrawDiagnostics  NonasciiDigit.java
     8  */
     8  */
     9 public class NonasciiDigit {
     9 public class NonasciiDigit {
    10     public static void main(String[] args) {
    10     public static void main(String[] args) {
       
    11         // error: only ASCII allowed in constants
       
    12         int i1 = \uff11;
       
    13         int i2 = 1\uff11;
       
    14         int i3 = \ud835\udfff;
    11         // error: floating literals use ascii only
    15         // error: floating literals use ascii only
    12         float f = 0.\uff11;
    16         double d1 = \uff11.0;
       
    17         double d2 = 0.\uff11;
       
    18         double d3 = 0x0P\uff11;
       
    19         double d4 = 0E\uff11;
       
    20         double d5 = .\uff11;
       
    21         double d6 = \ud835\udfff.0;
    13     }
    22     }
    14 }
    23 }