Array_getLong01.java revision 12651:6ef01bd40ce2
1228753Smm/*
2228753Smm * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
3228753Smm * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4228753Smm *
5228753Smm * This code is free software; you can redistribute it and/or modify it
6228753Smm * under the terms of the GNU General Public License version 2 only, as
7228753Smm * published by the Free Software Foundation.
8228753Smm *
9228753Smm * This code is distributed in the hope that it will be useful, but WITHOUT
10228753Smm * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11228753Smm * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12228753Smm * version 2 for more details (a copy is included in the LICENSE file that
13228753Smm * accompanied this code).
14228753Smm *
15228753Smm * You should have received a copy of the GNU General Public License version
16228753Smm * 2 along with this work; if not, write to the Free Software Foundation,
17228753Smm * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18228753Smm *
19228753Smm * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20228753Smm * or visit www.oracle.com if you need additional information or have any
21228753Smm * questions.
22228753Smm */
23228753Smm/*
24228753Smm */
25228753Smmpackage org.graalvm.compiler.jtt.reflect;
26228753Smm
27228753Smmimport java.lang.reflect.Array;
28228753Smm
29228753Smmimport org.junit.Test;
30228753Smm
31228753Smmimport org.graalvm.compiler.jtt.JTTTest;
32228753Smm
33228753Smmpublic class Array_getLong01 extends JTTTest {
34228753Smm
35228753Smm    private static final long[] array = {11, 21, 42};
36228753Smm
37228753Smm    public static long test(int i) {
38228753Smm        return Array.getLong(array, i);
39228753Smm    }
40228753Smm
41228753Smm    @Test
42228753Smm    public void run0() throws Throwable {
43228753Smm        runTest("test", 0);
44228753Smm    }
45228753Smm
46228753Smm    @Test
47228753Smm    public void run1() throws Throwable {
48228753Smm        runTest("test", 1);
49228753Smm    }
50228753Smm
51228753Smm    @Test
52228753Smm    public void run2() throws Throwable {
53228753Smm        runTest("test", 2);
54228753Smm    }
55228753Smm
56228753Smm    @Test
57228753Smm    public void run3() throws Throwable {
58228753Smm        runTest("test", 3);
59228753Smm    }
60228753Smm
61228753Smm}
62228753Smm