Path: blob/master/test/hotspot/jtreg/compiler/loopopts/TestCastFFAtPhi.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 826801726* @summary C2: assert(phi_type->isa_int() || phi_type->isa_ptr() || phi_type->isa_long()) failed: bad phi type27*28* @run main/othervm -Xcomp -XX:-TieredCompilation -XX:CompileOnly=TestCastFFAtPhi TestCastFFAtPhi29*30*/3132public class TestCastFFAtPhi {33static int N = 400;34static double dArrFld[] = new double[N];35static long iMeth_check_sum = 0;3637static {38init(dArrFld, 90.71133);39}4041float fArrFld[] = new float[N];4243public static void main(String[] strArr) {44TestCastFFAtPhi _instance = new TestCastFFAtPhi();45for (int i = 0; i < 10; i++) {46_instance.mainTest();47}48}4950void mainTest() {51int i24 = 121110, i28, i30;52float f2 = 2.486F;5354for (i28 = 322; i28 > 6; i28--) {55i30 = 1;56do {57i24 = (int) f2;58fArrFld[1] += i30;59switch (((i28 % 4) * 5) + 32) {60case 36:61f2 *= f2;62}63} while (++i30 < 80);64}65System.out.println(i24 + ",");66}6768public static void init(double[] a, double seed) {69for (int j = 0; j < a.length; j++) {70a[j] = (j % 2 == 0) ? seed + j : seed - j;71}72}73}747576