annotate test/compiler/8004741/Test8004741.java @ 20304:a22acf6d7598

8048112: G1 Full GC needs to support the case when the very first region is not available Summary: Refactor preparation for compaction during Full GC so that it lazily initializes the first compaction point. This also avoids problems later when the first region may not be committed. Also reviewed by K. Barrett. Reviewed-by: brutisso
author tschatzl
date Mon, 21 Jul 2014 10:00:31 +0200
parents 76341426b645
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7428
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
1 /*
7993
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
2 * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
7428
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
4 *
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
7 * published by the Free Software Foundation.
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
8 *
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
13 * accompanied this code).
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
14 *
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
18 *
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
21 * questions.
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
22 */
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
23
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
24 /*
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
25 * @test Test8004741.java
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
26 * @bug 8004741
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
27 * @summary Missing compiled exception handle table entry for multidimensional array allocation
7993
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
28 * @run main/othervm -Xmx64m -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:+StressCompiledExceptionHandlers -XX:+SafepointALot -XX:GuaranteedSafepointInterval=100 Test8004741
7428
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
29 * @run main/othervm -Xmx64m -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:+StressCompiledExceptionHandlers Test8004741
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
30 */
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
31
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
32 import java.util.*;
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
33
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
34 public class Test8004741 extends Thread {
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
35
7993
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
36 static int passed = 0;
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
37
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
38 /**
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
39 * Loop forever allocating 2-d arrays.
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
40 * Catches and rethrows all exceptions; in the case of ThreadDeath, increments passed.
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
41 * Note that passed is incremented here because this is the exception handler with
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
42 * the smallest scope; we only want to declare success in the case where it is highly
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
43 * likely that the test condition
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
44 * (exception in 2-d array alloc interrupted by ThreadDeath)
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
45 * actually occurs.
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
46 */
7428
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
47 static int[][] test(int a, int b) throws Exception {
7993
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
48 int[][] ar;
7428
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
49 try {
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
50 ar = new int[a][b];
7993
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
51 } catch (ThreadDeath e) {
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
52 System.out.println("test got ThreadDeath");
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
53 passed++;
7428
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
54 throw(e);
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
55 }
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
56 return ar;
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
57 }
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
58
7993
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
59 /* Cookbook wait-notify to track progress of test thread. */
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
60 Object progressLock = new Object();
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
61 private static final int NOT_STARTED = 0;
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
62 private static final int RUNNING = 1;
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
63 private static final int STOPPING = 2;
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
64
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
65 int progressState = NOT_STARTED;
7428
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
66
7993
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
67 void toState(int state) {
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
68 synchronized (progressLock) {
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
69 progressState = state;
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
70 progressLock.notify();
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
71 }
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
72 }
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
73
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
74 void waitFor(int state) {
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
75 synchronized (progressLock) {
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
76 while (progressState < state) {
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
77 try {
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
78 progressLock.wait();
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
79 } catch (InterruptedException e) {
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
80 e.printStackTrace();
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
81 System.out.println("unexpected InterruptedException");
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
82 fail();
7428
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
83 }
7993
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
84 }
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
85 if (progressState > state) {
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
86 System.out.println("unexpected test state change, expected " +
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
87 state + " but saw " + progressState);
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
88 fail();
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
89 }
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
90 }
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
91 }
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
92
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
93 /**
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
94 * Loops running test until some sort of an exception or error,
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
95 * expects to see ThreadDeath.
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
96 */
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
97 public void run() {
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
98 try {
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
99 // Print before state change, so that other thread is most likely
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
100 // to see this thread executing calls to test() in a loop.
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
101 System.out.println("thread running");
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
102 toState(RUNNING);
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
103 while (true) {
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
104 // (2,2) (2,10) (2,100) were observed to tickle the bug;
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
105 test(2, 100);
7428
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
106 }
7993
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
107 } catch (ThreadDeath e) {
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
108 // nothing to say, passing was incremented by the test.
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
109 } catch (Throwable e) {
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
110 e.printStackTrace();
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
111 System.out.println("unexpected Throwable " + e);
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
112 fail();
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
113 }
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
114 toState(STOPPING);
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
115 }
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
116
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
117 /**
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
118 * Runs a single trial of the test in a thread.
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
119 * No single trial is definitive, since the ThreadDeath
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
120 * exception might not land in the tested region of code.
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
121 */
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
122 public static void threadTest() throws InterruptedException {
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
123 Test8004741 t = new Test8004741();
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
124 t.start();
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
125 t.waitFor(RUNNING);
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
126 Thread.sleep(100);
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
127 System.out.println("stopping thread");
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
128 t.stop();
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
129 t.waitFor(STOPPING);
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
130 t.join();
7428
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
131 }
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
132
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
133 public static void main(String[] args) throws Exception {
7993
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
134 // Warm up "test"
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
135 // t will never be started.
7428
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
136 for (int n = 0; n < 11000; n++) {
7993
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
137 test(2, 100);
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
138 }
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
139
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
140 // Will this sleep help ensure that the compiler is run?
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
141 Thread.sleep(500);
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
142 passed = 0;
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
143
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
144 try {
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
145 test(-1, 100);
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
146 System.out.println("Missing NegativeArraySizeException #1");
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
147 fail();
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
148 } catch ( java.lang.NegativeArraySizeException e ) {
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
149 System.out.println("Saw expected NegativeArraySizeException #1");
7428
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
150 }
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
151
7993
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
152 try {
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
153 test(100, -1);
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
154 fail();
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
155 System.out.println("Missing NegativeArraySizeException #2");
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
156 fail();
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
157 } catch ( java.lang.NegativeArraySizeException e ) {
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
158 System.out.println("Saw expected NegativeArraySizeException #2");
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
159 }
7428
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
160
7993
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
161 /* Test repetitions. If the test succeeds-mostly, it succeeds,
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
162 * as long as it does not crash (the outcome if the exception range
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
163 * table entry for the array allocation is missing).
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
164 */
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
165 int N = 12;
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
166 for (int n = 0; n < N; n++) {
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
167 threadTest();
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
168 }
7428
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
169
7993
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
170 if (passed > N/2) {
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
171 System.out.println("Saw " + passed + " out of " + N + " possible ThreadDeath hits");
7428
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
172 System.out.println("PASSED");
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
173 } else {
7993
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
174 System.out.println("Too few ThreadDeath hits; expected at least " + N/2 +
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
175 " but saw only " + passed);
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
176 fail();
7428
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
177 }
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
178 }
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
179
7993
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
180 static void fail() {
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
181 System.out.println("FAILED");
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
182 System.exit(97);
76341426b645 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 7428
diff changeset
183 }
7428
2d6c433b1f38 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
184 };