2250N/A/*
2250N/A * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
2250N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2250N/A *
2250N/A * This code is free software; you can redistribute it and/or modify it
2250N/A * under the terms of the GNU General Public License version 2 only, as
2250N/A * published by the Free Software Foundation.
2250N/A *
2250N/A * This code is distributed in the hope that it will be useful, but WITHOUT
2250N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
2250N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
2250N/A * version 2 for more details (a copy is included in the LICENSE file that
2250N/A * accompanied this code).
2250N/A *
2250N/A * You should have received a copy of the GNU General Public License version
2250N/A * 2 along with this work; if not, write to the Free Software Foundation,
2250N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2250N/A *
2250N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2250N/A * or visit www.oracle.com if you need additional information or have any
2250N/A * questions.
2250N/A *
2250N/A */
2250N/A
2250N/A/**
2250N/A * @test
2250N/A * @bug 7024475
2250N/A * @summary loop doesn't terminate when compiled
2250N/A *
2250N/A * @run main Test7024475
2250N/A */
2250N/A
2250N/Apublic class Test7024475 {
2250N/A
2250N/A static int i;
2250N/A static int x1;
2250N/A static int[] bucket_B;
2250N/A
2250N/A static void test(Test7024475 test, int i, int c0, int j, int c1) {
2250N/A for (;;) {
2250N/A if (c1 > c0) {
2250N/A if (c0 > 253) {
2250N/A throw new InternalError("c0 = " + c0);
2250N/A }
2250N/A int index = c0 * 256 + c1;
2250N/A if (index == -1) return;
2250N/A i = bucket_B[index];
2250N/A if (1 < j - i && test != null)
2250N/A x1 = 0;
2250N/A j = i;
2250N/A c1--;
2250N/A } else {
2250N/A c0--;
2250N/A if (j <= 0)
2250N/A break;
2250N/A c1 = 255;
2250N/A }
2250N/A }
2250N/A }
2250N/A
2250N/A public static void main(String args[]) {
2250N/A Test7024475 t = new Test7024475();
2250N/A bucket_B = new int[256*256];
2250N/A for (int i = 1; i < 256*256; i++) {
2250N/A bucket_B[i] = 1;
2250N/A }
2250N/A for (int n = 0; n < 100000; n++) {
2250N/A test(t, 2, 85, 1, 134);
2250N/A }
2250N/A }
2250N/A}