# HG changeset patch # User Thomas Wuerthinger # Date 1425997682 -3600 # Node ID 15bb034480d7be6468be47fca2a5d7f79577d8b2 # Parent 34fd3a18f211a35d6bf40aa232f76a81e3d4f56a Add unit test for conditional elimination of IntegerTestNode. diff -r 34fd3a18f211 -r 15bb034480d7 graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ConditionalEliminationTest1.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ConditionalEliminationTest1.java Tue Mar 10 15:21:34 2015 +0100 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ConditionalEliminationTest1.java Tue Mar 10 15:28:02 2015 +0100 @@ -130,4 +130,27 @@ public void test4() { test("test4Snippet", "test4Snippet"); } + + @SuppressWarnings("all") + public static int test5Snippet(int a, int b) { + if ((b & 3) == 0) { + GraalDirectives.controlFlowAnchor(); + if ((b & 7) == 0) { + GraalDirectives.controlFlowAnchor(); + return 1; + } + } else { + GraalDirectives.controlFlowAnchor(); + if ((b & 1) == 0) { + GraalDirectives.controlFlowAnchor(); + return 2; + } + } + return 0; + } + + @Test + public void test5() { + test("test5Snippet", "test5Snippet"); + } }