langtools/test/tools/javac/boxing/T6816548.java
author mcimadamore
Thu, 03 Feb 2011 09:38:19 +0000
changeset 8239 d2c934e951e2
parent 5520 86e4b9a9da40
permissions -rw-r--r--
7014715: javac returns different error code for certain failure(s) Summary: javac silently crashes when emitting certain kinds of resolution diagnostics Reviewed-by: jjg
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2510
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
     1
/*
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 2510
diff changeset
     2
 * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
2510
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
     4
 *
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
     7
 * published by the Free Software Foundation.
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
     8
 *
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
    13
 * accompanied this code).
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
    14
 *
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
    18
 *
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 2510
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 2510
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 2510
diff changeset
    21
 * questions.
2510
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
    22
 */
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
    23
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
    24
/*
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
    25
 * @test
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
    26
 * @bug     6816548
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
    27
 * @summary Uninitialized register when performing casting + auto(un)boxing
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
    28
 * @author  mcimadamore
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
    29
 */
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
    30
public class T6816548 {
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
    31
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
    32
    public static void main(String[] args) {
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
    33
        testInt();
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
    34
        testShort();
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
    35
        testByte();
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
    36
        testChar();
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
    37
    }
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
    38
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
    39
    public static void testInt() {
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
    40
        final int fi = 0;
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
    41
        Byte b = fi;
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
    42
        Short s = fi;
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
    43
        Character c = fi;
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
    44
    }
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
    45
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
    46
    public static void testShort() {
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
    47
        final short fs = 0;
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
    48
        Byte b = fs;
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
    49
        Short s = fs;
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
    50
        Character c = fs;
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
    51
    }
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
    52
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
    53
    public static void testByte() {
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
    54
        final byte fb = 0;
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
    55
        Byte b = fb;
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
    56
        Short s = fb;
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
    57
        Character c = fb;
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
    58
    }
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
    59
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
    60
    public static void testChar() {
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
    61
        final char fc = '0';
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
    62
        Byte b = fc;
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
    63
        Short s = fc;
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
    64
        Character c = fc;
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
    65
    }
d7ba8e16a928 6816548: Uninitialized register when performing casting + auto(un)boxing
mcimadamore
parents:
diff changeset
    66
}