BC_castore.java revision 12651:6ef01bd40ce2
1189251Ssam/* 2189251Ssam * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. 3346981Scy * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4189251Ssam * 5252726Srpaulo * This code is free software; you can redistribute it and/or modify it 6252726Srpaulo * under the terms of the GNU General Public License version 2 only, as 7189251Ssam * published by the Free Software Foundation. 8189251Ssam * 9189251Ssam * This code is distributed in the hope that it will be useful, but WITHOUT 10189251Ssam * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11189251Ssam * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12214734Srpaulo * version 2 for more details (a copy is included in the LICENSE file that 13214734Srpaulo * accompanied this code). 14214734Srpaulo * 15281806Srpaulo * You should have received a copy of the GNU General Public License version 16346981Scy * 2 along with this work; if not, write to the Free Software Foundation, 17214734Srpaulo * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18214734Srpaulo * 19189251Ssam * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20189251Ssam * or visit www.oracle.com if you need additional information or have any 21189251Ssam * questions. 22189251Ssam */ 23189251Ssampackage org.graalvm.compiler.jtt.bytecode; 24346981Scy 25281806Srpauloimport org.junit.Test; 26346981Scy 27346981Scyimport org.graalvm.compiler.jtt.JTTTest; 28346981Scy 29281806Srpaulo/* 30346981Scy */ 31346981Scypublic class BC_castore extends JTTTest { 32346981Scy 33346981Scy static char[] array = {0, 0, 0, 0}; 34346981Scy 35346981Scy public static char test(int arg, char val) { 36346981Scy array[arg] = val; 37346981Scy return array[arg]; 38346981Scy } 39346981Scy 40346981Scy @Test 41346981Scy public void run0() throws Throwable { 42281806Srpaulo runTest("test", 0, ((char) 97)); 43281806Srpaulo } 44281806Srpaulo 45346981Scy @Test 46346981Scy public void run1() throws Throwable { 47281806Srpaulo runTest("test", 1, ((char) 65)); 48346981Scy } 49346981Scy 50346981Scy @Test 51346981Scy public void run2() throws Throwable { 52346981Scy runTest("test", 2, ((char) 42)); 53346981Scy } 54346981Scy 55346981Scy @Test 56346981Scy public void run3() throws Throwable { 57346981Scy runTest("test", 3, ((char) 120)); 58346981Scy } 59346981Scy 60346981Scy} 61346981Scy