|
| 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 8271272 |
| 27 | + * @summary C2: assert(!had_error) failed: bad dominance |
| 28 | + * |
| 29 | + * @run main/othervm -Xcomp -XX:-TieredCompilation -XX:CompileOnly=TestMainNeverExecuted TestMainNeverExecuted |
| 30 | + * |
| 31 | + */ |
| 32 | + |
| 33 | +public class TestMainNeverExecuted { |
| 34 | + public static long y; |
| 35 | + static int iArrFld[] = new int[400]; |
| 36 | + static long x = 0; |
| 37 | + |
| 38 | + public static void main(String[] strArr) { |
| 39 | + for (int i1 = 0; i1 < 100; i1++) |
| 40 | + vMeth(3, 5); |
| 41 | + } |
| 42 | + static void vMeth(int f, int g) { |
| 43 | + int i3 = 23; |
| 44 | + int i11 = 2, i12 = 12, i13 = 32901, i14 = 43741; |
| 45 | + for (i11 = 7; i11 < 325; ++i11) { |
| 46 | + i13 = 1; |
| 47 | + while ((i13 += 3) < 5) { |
| 48 | + iArrFld[i13 - 1] = 906; |
| 49 | + for (i14 = i13; i14 < 5; i14 += 2) { |
| 50 | + y += i14; |
| 51 | + i3 += i14; |
| 52 | + } |
| 53 | + } |
| 54 | + } |
| 55 | + x += i11 + i12 + i13 + i14; |
| 56 | + } |
| 57 | +} |
0 commit comments