Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/jdk17u
Path: blob/master/test/hotspot/jtreg/compiler/c2/LongCountedLoopAsUnswitchIff.java
64476 views
1
/*
2
* Copyright (c) 2021, Alibaba Group Holding Limited. 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
/*
26
* @test
27
* @bug 8271203
28
* @summary C2: assert(iff->Opcode() == Op_If || iff->Opcode() == Op_CountedLoopEnd || iff->Opcode() == Op_RangeCheck) failed: Check this code when new subtype is added
29
* @run main/othervm -Xbatch -XX:-TieredCompilation -XX:CompileOnly=compiler.c2.LongCountedLoopAsUnswitchIff::test compiler.c2.LongCountedLoopAsUnswitchIff
30
*/
31
32
package compiler.c2;
33
34
public class LongCountedLoopAsUnswitchIff {
35
static int iArrFld[] = new int[400];
36
37
public static void main(String[] strArr) {
38
for (int i = 0; i < 10; i++) {
39
test();
40
}
41
}
42
43
static void test() {
44
int i = 56, i2 = 22257;
45
46
do {
47
do {
48
int i24 = 1;
49
while (++i24 < 2) {
50
}
51
for (long l1 = i; l1 < 2; ++l1) {
52
iArrFld[0] += 5;
53
}
54
} while ((i2 -= 2) > 0);
55
for (long l3 = 8; l3 < 194; ++l3) {
56
}
57
} while (--i > 0);
58
}
59
}
60