Search in sources :

Example 1 with RecursionTestNode

use of org.graalvm.compiler.truffle.test.nodes.RecursionTestNode in project graal by oracle.

the class SimplePartialEvaluationTest method allowedRecursion.

@Test
public void allowedRecursion() {
    /* Recursion depth just below the threshold that reports it as too deep recursion. */
    FrameDescriptor fd = new FrameDescriptor();
    AbstractTestNode result = new RecursionTestNode(TruffleCompilerOptions.getValue(PEGraphDecoder.Options.InliningDepthError) - 5);
    assertPartialEvalEquals("constant42", new RootTestNode(fd, "allowedRecursion", result));
}
Also used : FrameDescriptor(com.oracle.truffle.api.frame.FrameDescriptor) AbstractTestNode(org.graalvm.compiler.truffle.test.nodes.AbstractTestNode) RecursionTestNode(org.graalvm.compiler.truffle.test.nodes.RecursionTestNode) RootTestNode(org.graalvm.compiler.truffle.test.nodes.RootTestNode) Test(org.junit.Test)

Example 2 with RecursionTestNode

use of org.graalvm.compiler.truffle.test.nodes.RecursionTestNode in project graal by oracle.

the class SimplePartialEvaluationTest method tooDeepRecursion.

@Test(expected = BailoutException.class)
public void tooDeepRecursion() {
    /* Recursion depth just above the threshold that reports it as too deep recursion. */
    FrameDescriptor fd = new FrameDescriptor();
    AbstractTestNode result = new RecursionTestNode(TruffleCompilerOptions.getValue(PEGraphDecoder.Options.InliningDepthError));
    assertPartialEvalEquals("constant42", new RootTestNode(fd, "tooDeepRecursion", result));
}
Also used : FrameDescriptor(com.oracle.truffle.api.frame.FrameDescriptor) AbstractTestNode(org.graalvm.compiler.truffle.test.nodes.AbstractTestNode) RecursionTestNode(org.graalvm.compiler.truffle.test.nodes.RecursionTestNode) RootTestNode(org.graalvm.compiler.truffle.test.nodes.RootTestNode) Test(org.junit.Test)

Aggregations

FrameDescriptor (com.oracle.truffle.api.frame.FrameDescriptor)2 AbstractTestNode (org.graalvm.compiler.truffle.test.nodes.AbstractTestNode)2 RecursionTestNode (org.graalvm.compiler.truffle.test.nodes.RecursionTestNode)2 RootTestNode (org.graalvm.compiler.truffle.test.nodes.RootTestNode)2 Test (org.junit.Test)2