Array_getInt01.java revision 12651:6ef01bd40ce2
1218885Sdim/*
2218885Sdim * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
3218885Sdim * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4218885Sdim *
5218885Sdim * This code is free software; you can redistribute it and/or modify it
6218885Sdim * under the terms of the GNU General Public License version 2 only, as
7218885Sdim * published by the Free Software Foundation.
8218885Sdim *
9218885Sdim * This code is distributed in the hope that it will be useful, but WITHOUT
10218885Sdim * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11218885Sdim * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12218885Sdim * version 2 for more details (a copy is included in the LICENSE file that
13218885Sdim * accompanied this code).
14218885Sdim *
15218885Sdim * You should have received a copy of the GNU General Public License version
16218885Sdim * 2 along with this work; if not, write to the Free Software Foundation,
17218885Sdim * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18218885Sdim *
19249423Sdim * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20249423Sdim * or visit www.oracle.com if you need additional information or have any
21249423Sdim * questions.
22218885Sdim */
23218885Sdim/*
24218885Sdim */
25218885Sdimpackage org.graalvm.compiler.jtt.reflect;
26218885Sdim
27218885Sdimimport java.lang.reflect.Array;
28218885Sdim
29218885Sdimimport org.junit.Test;
30218885Sdim
31218885Sdimimport org.graalvm.compiler.jtt.JTTTest;
32218885Sdim
33218885Sdimpublic class Array_getInt01 extends JTTTest {
34218885Sdim
35251662Sdim    private static final int[] array = {11, 21, 42};
36251662Sdim
37251662Sdim    public static int test(int i) {
38218885Sdim        return Array.getInt(array, i);
39218885Sdim    }
40218885Sdim
41218885Sdim    @Test
42218885Sdim    public void run0() throws Throwable {
43218885Sdim        runTest("test", 0);
44218885Sdim    }
45218885Sdim
46218885Sdim    @Test
47218885Sdim    public void run1() throws Throwable {
48218885Sdim        runTest("test", 1);
49218885Sdim    }
50218885Sdim
51218885Sdim    @Test
52218885Sdim    public void run2() throws Throwable {
53218885Sdim        runTest("test", 2);
54218885Sdim    }
55218885Sdim
56218885Sdim    @Test
57218885Sdim    public void run3() throws Throwable {
58218885Sdim        runTest("test", 3);
59218885Sdim    }
60218885Sdim
61218885Sdim}
62218885Sdim