@@ -0,0 +1,1815 @@
+/*%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 java.io.*;%0Aimport java.util.*;%0A%0Aimport org.junit.*;%0A%0Apublic class IfReorderTest extends GraalCompilerTest %7B%0A%0A    private static Object fieldA = Integer.class;%0A    private static Object fieldB = Double.class;%0A%0A    @Test%0A    public void test1() %7B%0A        test(%22test1Snippet%22, new ArrayList%3C%3E());%0A    %7D%0A%0A    public static Object test1Snippet(Object o) %7B%0A        /*%0A         * Serializable and List are not mutually exclusive, so these two IFs should never be%0A         * reordered.%0A         */%0A        if (branchProbability(0.1, o instanceof Serializable)) %7B%0A            return fieldA;%0A        %7D%0A        if (branchProbability(0.9, o instanceof List)) %7B%0A            return fieldB;%0A        %7D%0A        return null;%0A    %7D%0A%0A%7D%0A

test case for IfNode reordering fix (a300322)