use of org.graalvm.compiler.truffle.test.nodes.AddTestNode in project graal by oracle.
the class SimplePartialEvaluationTest method twoMergesLoopExplosion.
@Test
public void twoMergesLoopExplosion() {
FrameDescriptor fd = new FrameDescriptor();
AbstractTestNode result = new AddTestNode(new TwoMergesExplodedLoopTestNode(5), new ConstantTestNode(37));
assertPartialEvalEquals("constant42", new RootTestNode(fd, "twoMergesLoopExplosion", result));
}
use of org.graalvm.compiler.truffle.test.nodes.AddTestNode in project graal by oracle.
the class SimplePartialEvaluationTest method addConstants.
@Test
public void addConstants() {
FrameDescriptor fd = new FrameDescriptor();
AbstractTestNode result = new AddTestNode(new ConstantTestNode(40), new ConstantTestNode(2));
assertPartialEvalEquals("constant42", new RootTestNode(fd, "addConstants", result));
}
use of org.graalvm.compiler.truffle.test.nodes.AddTestNode 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.AddTestNode in project graal by oracle.
the class SimplePartialEvaluationTest method longAddConstants.
@Test
public void longAddConstants() {
FrameDescriptor fd = new FrameDescriptor();
AbstractTestNode result = new ConstantTestNode(2);
for (int i = 0; i < 20; ++i) {
result = new AddTestNode(result, new ConstantTestNode(2));
}
assertPartialEvalEquals("constant42", new RootTestNode(fd, "longAddConstants", result));
}
use of org.graalvm.compiler.truffle.test.nodes.AddTestNode 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));
}
Aggregations