@@ -0,0 +1,2132 @@
+/*%0A * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.%0A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.%0A *%0A * This code is free software; you can redistribute it and/or modify it%0A * under the terms of the GNU General Public License version 2 only, as%0A * published by the Free Software Foundation.%0A *%0A * This code is distributed in the hope that it will be useful, but WITHOUT%0A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or%0A * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License%0A * version 2 for more details (a copy is included in the LICENSE file that%0A * accompanied this code).%0A *%0A * You should have received a copy of the GNU General Public License version%0A * 2 along with this work; if not, write to the Free Software Foundation,%0A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.%0A *%0A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA%0A * or visit www.oracle.com if you need additional information or have any%0A * questions.%0A */%0Apackage com.oracle.graal.compiler.test;%0A%0Aimport org.junit.*;%0A%0Aimport com.oracle.graal.compiler.test.ea.EATestBase.TestClassInt;%0A%0Apublic class ShortCircuitNodeTest extends GraalCompilerTest %7B%0A%0A    @Test%0A    public void test1() %7B%0A        // only executeActual, to avoid creating profiling information%0A        executeActual(getMethod(%22test1Snippet%22), 1, 2);%0A    %7D%0A%0A    public static final TestClassInt field = null;%0A    public static TestClassInt field2 = null;%0A%0A    @SuppressWarnings(%22unused%22)%0A    public static void test1Snippet(int a, int b) %7B%0A        /*%0A         * if a ShortCircuitOrNode is created for the check inside test2, then faulty handling of%0A         * guards can create a cycle in the graph.%0A         */%0A        int v;%0A        if (a == 1) %7B%0A            if (b != 1) %7B%0A                int i = field.x;%0A            %7D%0A            field2 = null;%0A            v = 0;%0A        %7D else %7B%0A            v = 1;%0A        %7D%0A%0A        if (test2(v, b)) %7B%0A            int i = field.x;%0A        %7D%0A    %7D%0A%0A    public static boolean test2(int a, int b) %7B%0A        return a != 0 %7C%7C b != 1;%0A    %7D%0A%7D%0A

test for ShortCiruitNode/guard handling