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 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 * @modules java.base/jdk.internal.org.objectweb.asm
38 * java.base/sun.misc
39 * java.management
40 * @compile -XDignore.symbol.file TestANewArray.java
41 * @run main/othervm TestANewArray 49
42 * @run main/othervm TestANewArray 50
43 * @run main/othervm TestANewArray 51
44 * @run main/othervm TestANewArray 52
45 */
46
47 /*
48 * Testing anewarray instruction with 254, 255 & 264 dimensions to verify JVMS 8,
49 * Section 4.9.1, Static Constraints that states the following:
50 *
51 * "No anewarray instruction may be used to create an array of more than 255 dimensions."
|
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 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 jdk.test.lib.*;
32
33 /*
34 * @test
35 * @summary Test that anewarray bytecode is valid only if it specifies 255 or fewer dimensions.
36 * @library /testlibrary
37 * @modules java.base/jdk.internal.org.objectweb.asm
38 * java.base/sun.misc
39 * java.management
40 * @compile -XDignore.symbol.file TestANewArray.java
41 * @run main/othervm TestANewArray 49
42 * @run main/othervm TestANewArray 50
43 * @run main/othervm TestANewArray 51
44 * @run main/othervm TestANewArray 52
45 */
46
47 /*
48 * Testing anewarray instruction with 254, 255 & 264 dimensions to verify JVMS 8,
49 * Section 4.9.1, Static Constraints that states the following:
50 *
51 * "No anewarray instruction may be used to create an array of more than 255 dimensions."
|