jdk
64 строки · 2.2 Кб
1/*
2* Copyright (c) 2023, Oracle and/or its affiliates. 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 8314106
28* @summary Test that we do not try to copy a Parse Predicate to an unswitched loop if they do not exist anymore.
29* @run main/othervm -Xbatch -XX:-TieredCompilation
30* -XX:CompileCommand=compileonly,compiler.predicates.TestLoopUnswitchingWithoutParsePredicates::*
31* compiler.predicates.TestLoopUnswitchingWithoutParsePredicates
32*/
33
34package compiler.predicates;
35
36public class TestLoopUnswitchingWithoutParsePredicates {
37static byte byFld;
38static byte byArrFld[] = new byte[400];
39
40public static void main(String[] strArr) {
41for (int i = 0; i < 1000;i++) {
42test(i);
43}
44}
45
46static void test(int i2) {
47int i10, i11 = 0, i12, i13, i14;
48double dArr[] = new double[400];
49for (i10 = 7; i10 < 307; i10++) {
50byArrFld[i10] = 58;
51for (i12 = 1; i12 < 3; i12++) {
52for (i14 = 1; i14 < 2; i14++) {
53byFld &= i14;
54switch (i2) {
55case 4:
56dArr[1] = i14;
57case 2:
58i13 = i11;
59}
60}
61}
62}
63}
64}
65
66