< prev index next >

test/runtime/verifier/TestANewArray.java

Print this page




  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 import java.io.File;
  25 import java.io.FileOutputStream;
  26 
  27 import jdk.internal.org.objectweb.asm.ClassWriter;
  28 import jdk.internal.org.objectweb.asm.MethodVisitor;
  29 import static jdk.internal.org.objectweb.asm.Opcodes.*;
  30 
  31 import com.oracle.java.testlibrary.*;
  32 
  33 /*
  34  * @test
  35  * @summary Test that anewarray bytecode is valid only if it specifies 255 or fewer dimensions.
  36  * @library /testlibrary

  37  * @compile -XDignore.symbol.file TestANewArray.java
  38  * @run main/othervm TestANewArray 49
  39  * @run main/othervm TestANewArray 50
  40  * @run main/othervm TestANewArray 51
  41  * @run main/othervm TestANewArray 52
  42  */
  43 
  44 /*
  45  * Testing anewarray instruction with 254, 255 & 264 dimensions to verify JVMS 8,
  46  * Section 4.9.1, Static Constraints that states the following:
  47  *
  48  * "No anewarray instruction may be used to create an array of more than 255 dimensions."
  49  *
  50  */
  51 
  52 public class TestANewArray {
  53 
  54     static String classCName = null; // the generated class name
  55 
  56     static final int test_Dimension_254 = 254; // should always pass




  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 import java.io.File;
  25 import java.io.FileOutputStream;
  26 
  27 import jdk.internal.org.objectweb.asm.ClassWriter;
  28 import jdk.internal.org.objectweb.asm.MethodVisitor;
  29 import static jdk.internal.org.objectweb.asm.Opcodes.*;
  30 
  31 import com.oracle.java.testlibrary.*;
  32 
  33 /*
  34  * @test
  35  * @summary Test that anewarray bytecode is valid only if it specifies 255 or fewer dimensions.
  36  * @library /testlibrary
  37  * @build com.oracle.java.testlibrary.*
  38  * @compile -XDignore.symbol.file TestANewArray.java
  39  * @run main/othervm TestANewArray 49
  40  * @run main/othervm TestANewArray 50
  41  * @run main/othervm TestANewArray 51
  42  * @run main/othervm TestANewArray 52
  43  */
  44 
  45 /*
  46  * Testing anewarray instruction with 254, 255 & 264 dimensions to verify JVMS 8,
  47  * Section 4.9.1, Static Constraints that states the following:
  48  *
  49  * "No anewarray instruction may be used to create an array of more than 255 dimensions."
  50  *
  51  */
  52 
  53 public class TestANewArray {
  54 
  55     static String classCName = null; // the generated class name
  56 
  57     static final int test_Dimension_254 = 254; // should always pass


< prev index next >