< prev index next >

test/compiler/c2/Test8004741.java

Print this page
rev 11557 : 8132919: use package in compiler tests
Reviewed-by: duke


   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 Test8004741.java
  26  * @bug 8004741
  27  * @summary Missing compiled exception handle table entry for multidimensional array allocation
  28  * @run main/othervm -Xmx64m -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions -XX:-TieredCompilation -XX:+StressCompiledExceptionHandlers -XX:+SafepointALot -XX:GuaranteedSafepointInterval=100 Test8004741
  29  * @run main/othervm -Xmx64m -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions -XX:-TieredCompilation -XX:+StressCompiledExceptionHandlers Test8004741






  30  */
  31 
  32 import java.util.*;
  33 
  34 public class Test8004741 extends Thread {
  35 
  36   static int passed = 0;
  37 
  38   /**
  39    * Loop forever allocating 2-d arrays.
  40    * Catches and rethrows all exceptions; in the case of ThreadDeath, increments passed.
  41    * Note that passed is incremented here because this is the exception handler with
  42    * the smallest scope; we only want to declare success in the case where it is highly
  43    * likely that the test condition
  44    * (exception in 2-d array alloc interrupted by ThreadDeath)
  45    * actually occurs.
  46    */
  47   static int[][] test(int a, int b) throws Exception {
  48     int[][] ar;
  49     try {
  50       ar = new int[a][b];
  51     } catch (ThreadDeath e) {
  52       System.out.println("test got ThreadDeath");




   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 Test8004741.java
  26  * @bug 8004741
  27  * @summary Missing compiled exception handle table entry for multidimensional array allocation
  28  *
  29  * @run main/othervm -Xmx64m -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions
  30  *    -XX:-TieredCompilation -XX:+StressCompiledExceptionHandlers
  31  *    -XX:+SafepointALot -XX:GuaranteedSafepointInterval=100
  32  *    compiler.c2.Test8004741
  33  * @run main/othervm -Xmx64m -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions
  34  *    -XX:-TieredCompilation -XX:+StressCompiledExceptionHandlers
  35  *    compiler.c2.Test8004741
  36  */
  37 
  38 package compiler.c2;
  39 
  40 public class Test8004741 extends Thread {
  41 
  42   static int passed = 0;
  43 
  44   /**
  45    * Loop forever allocating 2-d arrays.
  46    * Catches and rethrows all exceptions; in the case of ThreadDeath, increments passed.
  47    * Note that passed is incremented here because this is the exception handler with
  48    * the smallest scope; we only want to declare success in the case where it is highly
  49    * likely that the test condition
  50    * (exception in 2-d array alloc interrupted by ThreadDeath)
  51    * actually occurs.
  52    */
  53   static int[][] test(int a, int b) throws Exception {
  54     int[][] ar;
  55     try {
  56       ar = new int[a][b];
  57     } catch (ThreadDeath e) {
  58       System.out.println("test got ThreadDeath");


< prev index next >