Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/jdk17u
Path: blob/master/test/hotspot/jtreg/compiler/loopopts/TestCastFFAtPhi.java
64478 views
1
/*
2
* Copyright (c) 2021, Red Hat, Inc. All rights reserved.
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
*
5
* This code is free software; you can redistribute it and/or modify it
6
* under the terms of the GNU General Public License version 2 only, as
7
* published by the Free Software Foundation.
8
*
9
* This code is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12
* version 2 for more details (a copy is included in the LICENSE file that
13
* accompanied this code).
14
*
15
* You should have received a copy of the GNU General Public License version
16
* 2 along with this work; if not, write to the Free Software Foundation,
17
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18
*
19
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20
* or visit www.oracle.com if you need additional information or have any
21
* questions.
22
*/
23
24
/**
25
* @test
26
* @bug 8268017
27
* @summary C2: assert(phi_type->isa_int() || phi_type->isa_ptr() || phi_type->isa_long()) failed: bad phi type
28
*
29
* @run main/othervm -Xcomp -XX:-TieredCompilation -XX:CompileOnly=TestCastFFAtPhi TestCastFFAtPhi
30
*
31
*/
32
33
public class TestCastFFAtPhi {
34
static int N = 400;
35
static double dArrFld[] = new double[N];
36
static long iMeth_check_sum = 0;
37
38
static {
39
init(dArrFld, 90.71133);
40
}
41
42
float fArrFld[] = new float[N];
43
44
public static void main(String[] strArr) {
45
TestCastFFAtPhi _instance = new TestCastFFAtPhi();
46
for (int i = 0; i < 10; i++) {
47
_instance.mainTest();
48
}
49
}
50
51
void mainTest() {
52
int i24 = 121110, i28, i30;
53
float f2 = 2.486F;
54
55
for (i28 = 322; i28 > 6; i28--) {
56
i30 = 1;
57
do {
58
i24 = (int) f2;
59
fArrFld[1] += i30;
60
switch (((i28 % 4) * 5) + 32) {
61
case 36:
62
f2 *= f2;
63
}
64
} while (++i30 < 80);
65
}
66
System.out.println(i24 + ",");
67
}
68
69
public static void init(double[] a, double seed) {
70
for (int j = 0; j < a.length; j++) {
71
a[j] = (j % 2 == 0) ? seed + j : seed - j;
72
}
73
}
74
}
75
76