NCE_FlowSensitive04.java revision 12651:6ef01bd40ce2
111858Smlarsson/* 213184Skbarrett * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. 311858Smlarsson * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 411858Smlarsson * 511858Smlarsson * This code is free software; you can redistribute it and/or modify it 611858Smlarsson * under the terms of the GNU General Public License version 2 only, as 711858Smlarsson * published by the Free Software Foundation. 811858Smlarsson * 911858Smlarsson * This code is distributed in the hope that it will be useful, but WITHOUT 1011858Smlarsson * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1111858Smlarsson * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1211858Smlarsson * version 2 for more details (a copy is included in the LICENSE file that 1311858Smlarsson * accompanied this code). 1411858Smlarsson * 1511858Smlarsson * You should have received a copy of the GNU General Public License version 1611858Smlarsson * 2 along with this work; if not, write to the Free Software Foundation, 1711858Smlarsson * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1811858Smlarsson * 1911858Smlarsson * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2011858Smlarsson * or visit www.oracle.com if you need additional information or have any 2111858Smlarsson * questions. 2211858Smlarsson */ 2312158Sstsmirnopackage org.graalvm.compiler.jtt.optimize; 2411858Smlarsson 2511858Smlarssonimport org.junit.Test; 2611858Smlarsson 2711858Smlarssonimport org.graalvm.compiler.jtt.JTTTest; 2813184Skbarrett 2911858Smlarsson/* 3011858Smlarsson */ 3111858Smlarssonpublic class NCE_FlowSensitive04 extends JTTTest { 3212129Smlarsson 3312129Smlarsson public static String test(String arg2) { 3412129Smlarsson String arg = arg2; 3512129Smlarsson if (arg == null) { 3612129Smlarsson arg = "null"; 3712129Smlarsson } 3811858Smlarsson // arg cannot be null here 3911858Smlarsson return arg.toString(); 4011858Smlarsson } 4111858Smlarsson 4211858Smlarsson @Test 4311936Srehn public void run0() throws Throwable { 4411858Smlarsson runTest("test", (Object) null); 4511858Smlarsson } 4611858Smlarsson 4711858Smlarsson @Test 4811858Smlarsson public void run1() throws Throwable { 4911858Smlarsson runTest("test", "x"); 5011858Smlarsson } 5111858Smlarsson 5211858Smlarsson @Test 5311858Smlarsson public void run2() throws Throwable { 5411858Smlarsson runTest("test", "yay"); 5511858Smlarsson } 5611858Smlarsson 5711858Smlarsson} 5811858Smlarsson