Path: blob/master/test/hotspot/jtreg/compiler/loopopts/TestDeadPostLoopBecausePredicate.java
64478 views
/*1* Copyright (c) 2021, Red Hat, Inc. 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 827533026* @summary C2: assert(n->is_Root() || n->is_Region() || n->is_Phi() || n->is_MachMerge() || def_block->dominates(block)) failed: uses must be dominated by definitions27*28* @run main/othervm -Xmx512m -XX:+UnlockDiagnosticVMOptions -Xcomp -XX:CompileOnly=TestDeadPostLoopBecausePredicate TestDeadPostLoopBecausePredicate29*30*/313233public class TestDeadPostLoopBecausePredicate {3435public static final int N = 400;3637public static int iFld=54270;38public static int iFld1=-4;39public int iFld2=201;4041public int mainTest(String[] strArr1) {4243int i=0, i17=8052, i19=22380, i20=60894, iArr[]=new int[N];44init(iArr, 4);4546i = 1;47do {48for (i17 = 5; i17 < 114; i17++) {49switch ((i17 % 7) + 126) {50case 126:51for (i19 = 2; i19 > i; i19 -= 3) {52try {53i20 = (iFld2 % TestDeadPostLoopBecausePredicate.iFld1);54i20 = (iArr[i19 - 1] % TestDeadPostLoopBecausePredicate.iFld);55TestDeadPostLoopBecausePredicate.iFld = (TestDeadPostLoopBecausePredicate.iFld1 % iArr[i19]);56} catch (ArithmeticException a_e) {}57}58break;59}60}61} while (++i < 220);6263return i20;64}6566public static void init(int[] a, int seed) {67for (int j = 0; j < a.length; j++) {68a[j] = (j % 2 == 0) ? seed + j : seed - j;69}70}7172public static void main(String[] strArr) {73TestDeadPostLoopBecausePredicate _instance = new TestDeadPostLoopBecausePredicate();74for (int i = 0; i < 10; i++ ) {75_instance.mainTest(strArr);76}77}78}798081