Test.java revision 704
704N/A/*
704N/A * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
704N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
704N/A *
704N/A * This code is free software; you can redistribute it and/or modify it
704N/A * under the terms of the GNU General Public License version 2 only, as
704N/A * published by the Free Software Foundation.
704N/A *
704N/A * This code is distributed in the hope that it will be useful, but WITHOUT
704N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
704N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
704N/A * version 2 for more details (a copy is included in the LICENSE file that
704N/A * accompanied this code).
704N/A *
704N/A * You should have received a copy of the GNU General Public License version
704N/A * 2 along with this work; if not, write to the Free Software Foundation,
704N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
704N/A *
704N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
704N/A * CA 95054 USA or visit www.sun.com if you need additional information or
704N/A * have any questions.
704N/A *
704N/A */
704N/A
704N/A/*
704N/A * @test
704N/A * @bug 6823453
704N/A * @summary DeoptimizeALot causes fastdebug server jvm to fail with assert(false,"unscheduable graph")
704N/A * @run main/othervm -Xcomp -XX:CompileOnly=Test -XX:+DeoptimizeALot Test
704N/A */
704N/A
704N/Apublic class Test {
704N/A
704N/A static long vara_1 = 1L;
704N/A
704N/A static void testa() {
704N/A short var_2 = (byte) 1.0E10;
704N/A
704N/A for ( Object temp = new byte[(byte)1.0E10]; true ;
704N/A var_2 = "1".equals("0") ? ((byte) vara_1) : 1 ) {}
704N/A }
704N/A
704N/A static void testb() {
704N/A long var_1 = -1L;
704N/A
704N/A short var_2 = (byte) 1.0E10;
704N/A
704N/A for ( Object temp = new byte[(byte)1.0E10]; true ;
704N/A var_2 = "1".equals("0") ? ((byte) var_1) : 1 ) {}
704N/A }
704N/A
704N/A static void testc() {
704N/A long var_1 = -1L;
704N/A if (vara_1 > 0) var_1 = 1L;
704N/A
704N/A int var_2 = (byte)var_1 - 128;
704N/A
704N/A for ( Object temp = new byte[var_2]; true ;
704N/A var_2 = "1".equals("0") ? 2 : 1 ) {}
704N/A }
704N/A
704N/A static void testd() {
704N/A long var_1 = 0L;
704N/A
704N/A int var_2 = (byte)var_1 + 1;
704N/A for (int i=0; i<2 ; i++) var_2 = var_2 - 1;
704N/A
704N/A for ( Object temp = new byte[var_2]; true ;
704N/A var_2 = "1".equals("0") ? 2 : 1 ) {}
704N/A }
704N/A
704N/A public static void main(String[] args) throws Exception {
704N/A int nex = 0;
704N/A
704N/A try {
704N/A testa();
704N/A }
704N/A catch (java.lang.NegativeArraySizeException ex) { nex++; }
704N/A try {
704N/A testb();
704N/A }
704N/A catch (java.lang.NegativeArraySizeException ex) { nex++; }
704N/A try {
704N/A testc();
704N/A }
704N/A catch (java.lang.NegativeArraySizeException ex) { nex++; }
704N/A try {
704N/A testd();
704N/A }
704N/A catch (java.lang.NegativeArraySizeException ex) { nex++; }
704N/A
704N/A if (nex != 4)
704N/A System.exit(97);
704N/A }
704N/A}
704N/A