use of org.graalvm.compiler.truffle.test.nodes.BlockTestNode in project graal by oracle.
the class SimplePartialEvaluationTest method longSequenceConstants.
@Test
public void longSequenceConstants() {
FrameDescriptor fd = new FrameDescriptor();
int length = 40;
AbstractTestNode[] children = new AbstractTestNode[length];
for (int i = 0; i < children.length; ++i) {
children[i] = new ConstantTestNode(42);
}
AbstractTestNode result = new BlockTestNode(children);
assertPartialEvalEquals("constant42", new RootTestNode(fd, "longSequenceConstants", result));
}
use of org.graalvm.compiler.truffle.test.nodes.BlockTestNode in project graal by oracle.
the class SimplePartialEvaluationTest method sequenceConstants.
@Test
public void sequenceConstants() {
FrameDescriptor fd = new FrameDescriptor();
AbstractTestNode result = new BlockTestNode(new AbstractTestNode[] { new ConstantTestNode(40), new ConstantTestNode(42) });
assertPartialEvalEquals("constant42", new RootTestNode(fd, "sequenceConstants", result));
}
use of org.graalvm.compiler.truffle.test.nodes.BlockTestNode in project graal by oracle.
the class SimplePartialEvaluationTest method mixLocalAndAdd.
@Test
public void mixLocalAndAdd() {
FrameDescriptor fd = new FrameDescriptor();
AbstractTestNode result = new BlockTestNode(new AbstractTestNode[] { new StoreLocalTestNode("x", fd, new ConstantTestNode(40)), new StoreLocalTestNode("x", fd, new AddTestNode(new LoadLocalTestNode("x", fd), new ConstantTestNode(2))), new LoadLocalTestNode("x", fd) });
assertPartialEvalEquals("constant42", new RootTestNode(fd, "mixLocalAndAdd", result));
}
use of org.graalvm.compiler.truffle.test.nodes.BlockTestNode 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.BlockTestNode 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));
}
Aggregations