use of org.graalvm.compiler.truffle.test.nodes.ConstantTestNode in project graal by oracle.
the class SimplePartialEvaluationTest method localVariable.
@Test
public void localVariable() {
FrameDescriptor fd = new FrameDescriptor();
AbstractTestNode result = new BlockTestNode(new AbstractTestNode[] { new StoreLocalTestNode("x", fd, new ConstantTestNode(42)), new LoadLocalTestNode("x", fd) });
assertPartialEvalEquals("constant42", new RootTestNode(fd, "localVariable", result));
}
use of org.graalvm.compiler.truffle.test.nodes.ConstantTestNode in project graal by oracle.
the class SimplePartialEvaluationTest method nestedLoopExplosion.
@Test
public void nestedLoopExplosion() {
FrameDescriptor fd = new FrameDescriptor();
AbstractTestNode result = new AddTestNode(new NestedExplodedLoopTestNode(5), new ConstantTestNode(17));
assertPartialEvalEquals("constant42", new RootTestNode(fd, "nestedLoopExplosion", result));
}
use of org.graalvm.compiler.truffle.test.nodes.ConstantTestNode in project graal by oracle.
the class SimplePartialEvaluationTest method loop.
@Test
public void loop() {
FrameDescriptor fd = new FrameDescriptor();
AbstractTestNode result = new BlockTestNode(new AbstractTestNode[] { new StoreLocalTestNode("x", fd, new ConstantTestNode(0)), new LoopTestNode(7, new StoreLocalTestNode("x", fd, new AddTestNode(new LoadLocalTestNode("x", fd), new ConstantTestNode(6)))) });
assertPartialEvalEquals("constant42", new RootTestNode(fd, "loop", result));
}
use of org.graalvm.compiler.truffle.test.nodes.ConstantTestNode in project graal by oracle.
the class SimplePartialEvaluationTest method longLoop.
@Test
public void longLoop() {
FrameDescriptor fd = new FrameDescriptor();
AbstractTestNode result = new BlockTestNode(new AbstractTestNode[] { new StoreLocalTestNode("x", fd, new ConstantTestNode(0)), new LoopTestNode(42, new StoreLocalTestNode("x", fd, new AddTestNode(new LoadLocalTestNode("x", fd), new ConstantTestNode(1)))) });
RootTestNode rootNode = new RootTestNode(fd, "loop", result);
assertPartialEvalNoInvokes(rootNode);
assertPartialEvalEquals("constant42", rootNode);
}
Aggregations