use of org.graalvm.compiler.truffle.test.nodes.RootTestNode in project graal by oracle.
the class CastExactPartialEvaluationTest method testCommon.
private void testCommon(AbstractTestNode testNode, String testName) {
FrameDescriptor fd = new FrameDescriptor();
RootNode rootNode = new RootTestNode(fd, testName, testNode);
RootCallTarget callTarget = Truffle.getRuntime().createCallTarget(rootNode);
Assert.assertEquals(42, callTarget.call(newBuffer()));
assertPartialEvalNoInvokes(callTarget, new Object[] { newBuffer() });
}
use of org.graalvm.compiler.truffle.test.nodes.RootTestNode in project graal by oracle.
the class CompilationFinalPartialEvaluationTest method compilationFinalTest1.
@Test
public void compilationFinalTest1() {
FrameDescriptor fd = new FrameDescriptor();
AbstractTestNode result = new CompilationFinalTestNode();
assertPartialEvalEquals("constant42", new RootTestNode(fd, "compilationFinalTest", result));
}
use of org.graalvm.compiler.truffle.test.nodes.RootTestNode in project graal by oracle.
the class CompilerAssertsTest method compilationConstantTest.
@Test
public void compilationConstantTest() {
FrameDescriptor descriptor = new FrameDescriptor();
CompilationConstantTestNode result = new CompilationConstantTestNode(new ConstantTestNode(5));
RootTestNode rootNode = new RootTestNode(descriptor, "compilationConstant", result);
compileHelper("compilationConstant", rootNode, new Object[0]);
}
use of org.graalvm.compiler.truffle.test.nodes.RootTestNode in project graal by oracle.
the class CompilerAssertsTest method neverPartOfCompilationTest.
@Test
public void neverPartOfCompilationTest() {
NeverPartOfCompilationTestNode result = new NeverPartOfCompilationTestNode();
RootTestNode rootNode = new RootTestNode(new FrameDescriptor(), "neverPartOfCompilation", result);
try {
compileHelper("neverPartOfCompilation", rootNode, new Object[0]);
Assert.fail("Expected bailout exception due to never part of compilation");
} catch (BailoutException e) {
// Bailout exception expected.
}
}
use of org.graalvm.compiler.truffle.test.nodes.RootTestNode in project graal by oracle.
the class ControlFlowExceptionPartialEvaluationTest method catchControlFlowExceptionFromCall.
@Test
public void catchControlFlowExceptionFromCall() {
Assume.assumeTrue(TruffleCompilerOptions.getValue(TruffleFunctionInlining));
CallTarget callTarget = Truffle.getRuntime().createCallTarget(new RootTestNode(new FrameDescriptor(), "throwControlFlowException", new ThrowControlFlowExceptionTestNode()));
AbstractTestNode result = new CatchControlFlowExceptionTestNode(new CallTestNode(callTarget));
assertPartialEvalEquals("constant42", new RootTestNode(new FrameDescriptor(), "catchControlFlowExceptionFromCall", result));
}
Aggregations