Mercurial > hg > truffle
changeset 19752:15bb034480d7
Add unit test for conditional elimination of IntegerTestNode.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Tue, 10 Mar 2015 15:28:02 +0100 |
parents | 34fd3a18f211 |
children | dde8a89e7f92 |
files | graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ConditionalEliminationTest1.java |
diffstat | 1 files changed, 23 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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"); + } }