Path: blob/master/test/hotspot/jtreg/compiler/c2/Test6823453.java
41149 views
/*1* Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/2223/*24* @test25* @bug 682345326* @summary DeoptimizeALot causes fastdebug server jvm to fail with assert(false,"unscheduable graph")27*28* @run main/othervm -Xcomp -XX:+IgnoreUnrecognizedVMOptions -XX:+DeoptimizeALot29* -XX:CompileCommand=compileonly,compiler.c2.Test6823453::*30* compiler.c2.Test682345331*/3233package compiler.c2;3435public class Test6823453 {3637static long vara_1 = 1L;3839static void testa() {40short var_2 = (byte) 1.0E10;4142for (Object temp = new byte[(byte) 1.0E10]; true;43var_2 = "1".equals("0") ? ((byte) vara_1) : 1) {44}45}4647static void testb() {48long var_1 = -1L;4950short var_2 = (byte) 1.0E10;5152for (Object temp = new byte[(byte) 1.0E10]; true;53var_2 = "1".equals("0") ? ((byte) var_1) : 1) {54}55}5657static void testc() {58long var_1 = -1L;59if (vara_1 > 0) var_1 = 1L;6061int var_2 = (byte) var_1 - 128;6263for (Object temp = new byte[var_2]; true;64var_2 = "1".equals("0") ? 2 : 1) {65}66}6768static void testd() {69long var_1 = 0L;7071int var_2 = (byte) var_1 + 1;72for (int i = 0; i < 2; i++) var_2 = var_2 - 1;7374for (Object temp = new byte[var_2]; true;75var_2 = "1".equals("0") ? 2 : 1) {76}77}7879public static void main(String[] args) throws Exception {80int nex = 0;8182try {83testa();84} catch (java.lang.NegativeArraySizeException ex) {85nex++;86}87try {88testb();89} catch (java.lang.NegativeArraySizeException ex) {90nex++;91}92try {93testc();94} catch (java.lang.NegativeArraySizeException ex) {95nex++;96}97try {98testd();99} catch (java.lang.NegativeArraySizeException ex) {100nex++;101}102103if (nex != 4)104System.exit(97);105}106}107108109110