use of org.graalvm.compiler.truffle.test.nodes.AssumptionCutsBranchTestNode in project graal by oracle.
the class AssumptionPartialEvaluationTest method assumptionBranchCutoff.
/**
* Tests whether a valid {@link Assumption} cuts off a non-executed branch.
*/
@Test
public void assumptionBranchCutoff() {
Assumption assumption = Truffle.getRuntime().createAssumption();
AssumptionCutsBranchTestNode result = new AssumptionCutsBranchTestNode(assumption);
RootTestNode rootNode = new RootTestNode(new FrameDescriptor(), "cutoffBranch", result);
OptimizedCallTarget compilable = compileHelper("cutoffBranch", rootNode, new Object[0]);
for (int i = 0; i < 100000; i++) {
Assert.assertEquals(0, compilable.call(new Object[0]));
}
Assert.assertNull(result.getChildNode());
}
Aggregations