Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/jdk17u
Path: blob/master/test/hotspot/jtreg/compiler/loopopts/TestDeadPostLoopBecausePredicate.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 8275330
27
* @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 definitions
28
*
29
* @run main/othervm -Xmx512m -XX:+UnlockDiagnosticVMOptions -Xcomp -XX:CompileOnly=TestDeadPostLoopBecausePredicate TestDeadPostLoopBecausePredicate
30
*
31
*/
32
33
34
public class TestDeadPostLoopBecausePredicate {
35
36
public static final int N = 400;
37
38
public static int iFld=54270;
39
public static int iFld1=-4;
40
public int iFld2=201;
41
42
public int mainTest(String[] strArr1) {
43
44
int i=0, i17=8052, i19=22380, i20=60894, iArr[]=new int[N];
45
init(iArr, 4);
46
47
i = 1;
48
do {
49
for (i17 = 5; i17 < 114; i17++) {
50
switch ((i17 % 7) + 126) {
51
case 126:
52
for (i19 = 2; i19 > i; i19 -= 3) {
53
try {
54
i20 = (iFld2 % TestDeadPostLoopBecausePredicate.iFld1);
55
i20 = (iArr[i19 - 1] % TestDeadPostLoopBecausePredicate.iFld);
56
TestDeadPostLoopBecausePredicate.iFld = (TestDeadPostLoopBecausePredicate.iFld1 % iArr[i19]);
57
} catch (ArithmeticException a_e) {}
58
}
59
break;
60
}
61
}
62
} while (++i < 220);
63
64
return i20;
65
}
66
67
public static void init(int[] a, int seed) {
68
for (int j = 0; j < a.length; j++) {
69
a[j] = (j % 2 == 0) ? seed + j : seed - j;
70
}
71
}
72
73
public static void main(String[] strArr) {
74
TestDeadPostLoopBecausePredicate _instance = new TestDeadPostLoopBecausePredicate();
75
for (int i = 0; i < 10; i++ ) {
76
_instance.mainTest(strArr);
77
}
78
}
79
}
80
81