< prev index next >

test/compiler/c1/CanonicalizeArrayLength.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
  26  * @bug 8150102 8150514 8150534
  27  * @summary C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
  28  * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions -XX:CompileThreshold=100 -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -XX:-BackgroundCompilation CanonicalizeArrayLength
  29  * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions -XX:CompileThreshold=100 -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -XX:-BackgroundCompilation -XX:+PatchALot CanonicalizeArrayLength
  30  * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions -XX:CompileThreshold=100 -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -XX:-BackgroundCompilation -XX:ScavengeRootsInCode=0 CanonicalizeArrayLength
  31  * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions -XX:CompileThreshold=100 -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -XX:-BackgroundCompilation -XX:ScavengeRootsInCode=1 CanonicalizeArrayLength















  32  */



  33 public class CanonicalizeArrayLength {
  34     int[] arr = new int[42];
  35     int[] arrNull = null;
  36 
  37     final int[] finalArr = new int[42];
  38     final int[] finalArrNull = null;
  39 
  40     static int[] staticArr = new int[42];
  41     static int[] staticArrNull = null;
  42 
  43     static final int[] staticFinalArr = new int[42];
  44     static final int[] staticFinalArrNull = null;
  45 
  46     public static void main(String... args) {
  47         CanonicalizeArrayLength t = new CanonicalizeArrayLength();
  48         for (int i = 0; i < 20000; i++) {
  49             if (t.testLocal() != 42)
  50                 throw new IllegalStateException();
  51             if (t.testLocalNull() != 42)
  52                 throw new IllegalStateException();




   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
  26  * @bug 8150102 8150514 8150534
  27  * @summary C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
  28  *
  29  * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions
  30  *                   -XX:CompileThreshold=100 -XX:+TieredCompilation -XX:TieredStopAtLevel=1
  31  *                   -XX:-BackgroundCompilation
  32  *                   compiler.c1.CanonicalizeArrayLength
  33  * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions
  34  *                   -XX:CompileThreshold=100 -XX:+TieredCompilation -XX:TieredStopAtLevel=1
  35  *                   -XX:-BackgroundCompilation
  36  *                   -XX:+PatchALot
  37  *                   compiler.c1.CanonicalizeArrayLength
  38  * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions
  39  *                   -XX:CompileThreshold=100 -XX:+TieredCompilation -XX:TieredStopAtLevel=1
  40  *                   -XX:-BackgroundCompilation
  41  *                   -XX:ScavengeRootsInCode=0
  42  *                   compiler.c1.CanonicalizeArrayLength
  43  * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions
  44  *                   -XX:CompileThreshold=100 -XX:+TieredCompilation -XX:TieredStopAtLevel=1
  45  *                   -XX:-BackgroundCompilation -XX:ScavengeRootsInCode=1
  46  *                   compiler.c1.CanonicalizeArrayLength
  47  */
  48 
  49 package compiler.c1;
  50 
  51 public class CanonicalizeArrayLength {
  52     int[] arr = new int[42];
  53     int[] arrNull = null;
  54 
  55     final int[] finalArr = new int[42];
  56     final int[] finalArrNull = null;
  57 
  58     static int[] staticArr = new int[42];
  59     static int[] staticArrNull = null;
  60 
  61     static final int[] staticFinalArr = new int[42];
  62     static final int[] staticFinalArrNull = null;
  63 
  64     public static void main(String... args) {
  65         CanonicalizeArrayLength t = new CanonicalizeArrayLength();
  66         for (int i = 0; i < 20000; i++) {
  67             if (t.testLocal() != 42)
  68                 throw new IllegalStateException();
  69             if (t.testLocalNull() != 42)
  70                 throw new IllegalStateException();


< prev index next >