hotspot/test/compiler/8004741/Test8004741.java
author drchase
Fri, 25 Jan 2013 16:09:14 -0800
changeset 15474 62425bb6b9e3
parent 14835 70896cb93c35
permissions -rw-r--r--
8006500: compiler/8004741/Test8004741.java fails intermediately Summary: rewrote the test to be more reliable, add test for invalid size exception Reviewed-by: kvn
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
14835
70896cb93c35 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
     1
/*
15474
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
     2
 * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
14835
70896cb93c35 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.
70896cb93c35 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
     4
 *
70896cb93c35 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
70896cb93c35 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
70896cb93c35 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
     7
 * published by the Free Software Foundation.
70896cb93c35 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
     8
 *
70896cb93c35 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
70896cb93c35 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
70896cb93c35 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
70896cb93c35 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
70896cb93c35 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
    13
 * accompanied this code).
70896cb93c35 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
    14
 *
70896cb93c35 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
70896cb93c35 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,
70896cb93c35 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.
70896cb93c35 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
    18
 *
70896cb93c35 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
70896cb93c35 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
70896cb93c35 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
    21
 * questions.
70896cb93c35 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
    22
 */
70896cb93c35 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
    23
70896cb93c35 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
    24
/*
70896cb93c35 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
    25
 * @test Test8004741.java
70896cb93c35 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
    26
 * @bug 8004741
70896cb93c35 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
15474
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    28
 * @run main/othervm -Xmx64m -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:+StressCompiledExceptionHandlers -XX:+SafepointALot -XX:GuaranteedSafepointInterval=100 Test8004741
14835
70896cb93c35 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
70896cb93c35 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
    30
 */
70896cb93c35 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
    31
70896cb93c35 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
    32
import java.util.*;
70896cb93c35 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
    33
70896cb93c35 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
    34
public class Test8004741 extends Thread {
70896cb93c35 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
    35
15474
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    36
  static int passed = 0;
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    37
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    38
  /**
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    39
   * Loop forever allocating 2-d arrays.
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    40
   * Catches and rethrows all exceptions; in the case of ThreadDeath, increments passed.
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    41
   * Note that passed is incremented here because this is the exception handler with
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    42
   * the smallest scope; we only want to declare success in the case where it is highly
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    43
   * likely that the test condition
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    44
   * (exception in 2-d array alloc interrupted by ThreadDeath)
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    45
   * actually occurs.
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    46
   */
14835
70896cb93c35 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 {
15474
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    48
    int[][] ar;
14835
70896cb93c35 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
    49
    try {
70896cb93c35 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
    50
      ar = new int[a][b];
15474
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    51
    } catch (ThreadDeath e) {
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    52
      System.out.println("test got ThreadDeath");
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    53
      passed++;
14835
70896cb93c35 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
    54
      throw(e);
70896cb93c35 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
    55
    }
70896cb93c35 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
    56
    return ar;
70896cb93c35 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
    57
  }
70896cb93c35 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
    58
15474
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    59
  /* Cookbook wait-notify to track progress of test thread. */
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    60
  Object progressLock = new Object();
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    61
  private static final int NOT_STARTED = 0;
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    62
  private static final int RUNNING = 1;
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    63
  private static final int STOPPING = 2;
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    64
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    65
  int progressState = NOT_STARTED;
14835
70896cb93c35 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
    66
15474
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    67
  void toState(int state) {
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    68
    synchronized (progressLock) {
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    69
      progressState = state;
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    70
      progressLock.notify();
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    71
    }
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    72
  }
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    73
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    74
  void waitFor(int state) {
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    75
    synchronized (progressLock) {
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    76
      while (progressState < state) {
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    77
        try {
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    78
          progressLock.wait();
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    79
        } catch (InterruptedException e) {
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    80
          e.printStackTrace();
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    81
          System.out.println("unexpected InterruptedException");
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    82
          fail();
14835
70896cb93c35 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
    83
        }
15474
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    84
      }
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    85
      if (progressState > state) {
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    86
        System.out.println("unexpected test state change, expected " +
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    87
                            state + " but saw " + progressState);
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    88
        fail();
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    89
      }
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    90
    }
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    91
  }
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    92
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    93
  /**
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    94
   * Loops running test until some sort of an exception or error,
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    95
   * expects to see ThreadDeath.
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    96
   */
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    97
  public void run() {
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    98
    try {
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
    99
      // Print before state change, so that other thread is most likely
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   100
      // to see this thread executing calls to test() in a loop.
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   101
      System.out.println("thread running");
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   102
      toState(RUNNING);
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   103
      while (true) {
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   104
        // (2,2) (2,10) (2,100) were observed to tickle the bug;
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   105
        test(2, 100);
14835
70896cb93c35 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
   106
      }
15474
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   107
    } catch (ThreadDeath e) {
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   108
      // nothing to say, passing was incremented by the test.
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   109
    } catch (Throwable e) {
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   110
      e.printStackTrace();
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   111
      System.out.println("unexpected Throwable " + e);
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   112
      fail();
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   113
    }
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   114
    toState(STOPPING);
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   115
  }
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   116
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   117
  /**
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   118
   * Runs a single trial of the test in a thread.
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   119
   * No single trial is definitive, since the ThreadDeath
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   120
   * exception might not land in the tested region of code.
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   121
   */
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   122
  public static void threadTest() throws InterruptedException {
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   123
    Test8004741 t = new Test8004741();
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   124
    t.start();
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   125
    t.waitFor(RUNNING);
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   126
    Thread.sleep(100);
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   127
    System.out.println("stopping thread");
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   128
    t.stop();
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   129
    t.waitFor(STOPPING);
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   130
    t.join();
14835
70896cb93c35 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
   131
  }
70896cb93c35 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
   132
70896cb93c35 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
   133
  public static void main(String[] args) throws Exception {
15474
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   134
    // Warm up "test"
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   135
    // t will never be started.
14835
70896cb93c35 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
   136
    for (int n = 0; n < 11000; n++) {
15474
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   137
      test(2, 100);
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   138
    }
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   139
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   140
    // Will this sleep help ensure that the compiler is run?
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   141
    Thread.sleep(500);
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   142
    passed = 0;
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   143
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   144
    try {
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   145
      test(-1, 100);
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   146
      System.out.println("Missing NegativeArraySizeException #1");
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   147
      fail();
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   148
    } catch ( java.lang.NegativeArraySizeException e ) {
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   149
      System.out.println("Saw expected NegativeArraySizeException #1");
14835
70896cb93c35 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
   150
    }
70896cb93c35 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
   151
15474
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   152
    try {
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   153
      test(100, -1);
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   154
      fail();
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   155
      System.out.println("Missing NegativeArraySizeException #2");
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   156
      fail();
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   157
    } catch ( java.lang.NegativeArraySizeException e ) {
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   158
      System.out.println("Saw expected NegativeArraySizeException #2");
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   159
    }
14835
70896cb93c35 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
   160
15474
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   161
    /* Test repetitions.  If the test succeeds-mostly, it succeeds,
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   162
     * as long as it does not crash (the outcome if the exception range
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   163
     * table entry for the array allocation is missing).
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   164
     */
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   165
    int N = 12;
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   166
    for (int n = 0; n < N; n++) {
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   167
      threadTest();
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   168
    }
14835
70896cb93c35 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
   169
15474
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   170
    if (passed > N/2) {
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   171
      System.out.println("Saw " + passed + " out of " + N + " possible ThreadDeath hits");
14835
70896cb93c35 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
   172
      System.out.println("PASSED");
70896cb93c35 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
   173
    } else {
15474
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   174
      System.out.println("Too few ThreadDeath hits; expected at least " + N/2 +
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   175
                         " but saw only " + passed);
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   176
      fail();
14835
70896cb93c35 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
   177
    }
70896cb93c35 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
   178
  }
70896cb93c35 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
   179
15474
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   180
  static void fail() {
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   181
    System.out.println("FAILED");
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   182
    System.exit(97);
62425bb6b9e3 8006500: compiler/8004741/Test8004741.java fails intermediately
drchase
parents: 14835
diff changeset
   183
  }
14835
70896cb93c35 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents:
diff changeset
   184
};