Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/test/compiler/6823453/Test.java
32285 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*22*/2324/*25* @test26* @bug 682345327* @summary DeoptimizeALot causes fastdebug server jvm to fail with assert(false,"unscheduable graph")28* @run main/othervm -Xcomp -XX:+IgnoreUnrecognizedVMOptions -XX:CompileOnly=Test -XX:+DeoptimizeALot Test29*/3031public class Test {3233static long vara_1 = 1L;3435static void testa() {36short var_2 = (byte) 1.0E10;3738for ( Object temp = new byte[(byte)1.0E10]; true ;39var_2 = "1".equals("0") ? ((byte) vara_1) : 1 ) {}40}4142static void testb() {43long var_1 = -1L;4445short var_2 = (byte) 1.0E10;4647for ( Object temp = new byte[(byte)1.0E10]; true ;48var_2 = "1".equals("0") ? ((byte) var_1) : 1 ) {}49}5051static void testc() {52long var_1 = -1L;53if (vara_1 > 0) var_1 = 1L;5455int var_2 = (byte)var_1 - 128;5657for ( Object temp = new byte[var_2]; true ;58var_2 = "1".equals("0") ? 2 : 1 ) {}59}6061static void testd() {62long var_1 = 0L;6364int var_2 = (byte)var_1 + 1;65for (int i=0; i<2 ; i++) var_2 = var_2 - 1;6667for ( Object temp = new byte[var_2]; true ;68var_2 = "1".equals("0") ? 2 : 1 ) {}69}7071public static void main(String[] args) throws Exception {72int nex = 0;7374try {75testa();76}77catch (java.lang.NegativeArraySizeException ex) { nex++; }78try {79testb();80}81catch (java.lang.NegativeArraySizeException ex) { nex++; }82try {83testc();84}85catch (java.lang.NegativeArraySizeException ex) { nex++; }86try {87testd();88}89catch (java.lang.NegativeArraySizeException ex) { nex++; }9091if (nex != 4)92System.exit(97);93}94}95969798