Array_newInstance01.java revision 12657:6ef01bd40ce2
1279377Simp/* 2279377Simp * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. 3279377Simp * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4279377Simp * 5279377Simp * This code is free software; you can redistribute it and/or modify it 6279377Simp * under the terms of the GNU General Public License version 2 only, as 7279377Simp * published by the Free Software Foundation. 8279377Simp * 9279377Simp * This code is distributed in the hope that it will be useful, but WITHOUT 10279377Simp * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11279377Simp * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12279377Simp * version 2 for more details (a copy is included in the LICENSE file that 13279377Simp * accompanied this code). 14279377Simp * 15279377Simp * You should have received a copy of the GNU General Public License version 16279377Simp * 2 along with this work; if not, write to the Free Software Foundation, 17279377Simp * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18279377Simp * 19279377Simp * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20279377Simp * or visit www.oracle.com if you need additional information or have any 21279377Simp * questions. 22279377Simp */ 23279377Simp/* 24279377Simp */ 25279377Simppackage org.graalvm.compiler.jtt.reflect; 26279377Simp 27279377Simpimport java.lang.reflect.Array; 28279377Simp 29279377Simpimport org.junit.Test; 30279377Simp 31279377Simpimport org.graalvm.compiler.jtt.JTTTest; 32279377Simp 33279377Simppublic class Array_newInstance01 extends JTTTest { 34279377Simp 35279377Simp public static boolean test(int i) { 36279377Simp return Array.newInstance(Array_newInstance01.class, i) != null; 37279377Simp } 38279377Simp 39279377Simp @Test 40279377Simp public void run0() throws Throwable { 41279377Simp runTest("test", 1); 42279377Simp } 43279377Simp 44279377Simp @Test 45279377Simp public void run1() throws Throwable { 46279377Simp runTest("test", 2); 47279377Simp } 48279377Simp 49279377Simp @Test 50279377Simp public void run2() throws Throwable { 51279377Simp runTest("test", 3); 52279377Simp } 53279377Simp 54279377Simp @Test 55279377Simp public void run3() throws Throwable { 56279377Simp runTest("test", -1); 57279377Simp } 58279377Simp 59279377Simp} 60279377Simp