Skip to content

Commit 12abba9

Browse files
shyamkishororaclePaul Hohensee
authored andcommitted
8357816: Add test from JDK-8350576
Backport-of: d8c3533a91aa9c3a0b76846fe425c72bda9bd66c
1 parent e321014 commit 12abba9

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/*
2+
* Copyright (c) 2025, 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+
* @test
26+
* @bug 8350576
27+
* @summary Optimization bails out and hits an assert:
28+
* assert(false) failed: reduction has ctrl or bad vector_input
29+
* @run main/othervm -Xbatch -XX:-TieredCompilation
30+
* -XX:CompileCommand=compileonly,compiler.loopopts.LoopReductionHasControlOrBadInput::*
31+
* compiler.loopopts.LoopReductionHasControlOrBadInput
32+
* @run main compiler.loopopts.LoopReductionHasControlOrBadInput
33+
*
34+
*/
35+
36+
package compiler.loopopts;
37+
38+
public class LoopReductionHasControlOrBadInput {
39+
static long lFld;
40+
static long lArr[] = new long[400];
41+
42+
static void test() {
43+
int i = 1;
44+
do {
45+
long x = -1;
46+
lArr[i] = i;
47+
lFld += i | x;
48+
} while (++i < 355);
49+
}
50+
51+
public static void main(String[] strArr) {
52+
for (int i = 0; i < 100; i++) {
53+
test();
54+
}
55+
}
56+
}

0 commit comments

Comments
 (0)