|
1 /* |
|
2 * Copyright (c) 2011, 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 7024475 |
|
28 * @summary loop doesn't terminate when compiled |
|
29 * |
|
30 * @run main Test7024475 |
|
31 */ |
|
32 |
|
33 public class Test7024475 { |
|
34 |
|
35 static int i; |
|
36 static int x1; |
|
37 static int[] bucket_B; |
|
38 |
|
39 static void test(Test7024475 test, int i, int c0, int j, int c1) { |
|
40 for (;;) { |
|
41 if (c1 > c0) { |
|
42 if (c0 > 253) { |
|
43 throw new InternalError("c0 = " + c0); |
|
44 } |
|
45 int index = c0 * 256 + c1; |
|
46 if (index == -1) return; |
|
47 i = bucket_B[index]; |
|
48 if (1 < j - i && test != null) |
|
49 x1 = 0; |
|
50 j = i; |
|
51 c1--; |
|
52 } else { |
|
53 c0--; |
|
54 if (j <= 0) |
|
55 break; |
|
56 c1 = 255; |
|
57 } |
|
58 } |
|
59 } |
|
60 |
|
61 public static void main(String args[]) { |
|
62 Test7024475 t = new Test7024475(); |
|
63 bucket_B = new int[256*256]; |
|
64 for (int i = 1; i < 256*256; i++) { |
|
65 bucket_B[i] = 1; |
|
66 } |
|
67 for (int n = 0; n < 100000; n++) { |
|
68 test(t, 2, 85, 1, 134); |
|
69 } |
|
70 } |
|
71 } |