Search in sources :

Example 1 with NonConstantTestNode

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

the class CompilerAssertsTest method compilationNonConstantTest.

@Test
public void compilationNonConstantTest() {
    FrameDescriptor descriptor = new FrameDescriptor();
    CompilationConstantTestNode result = new CompilationConstantTestNode(new NonConstantTestNode(5));
    RootTestNode rootNode = new RootTestNode(descriptor, "compilationConstant", result);
    try {
        compileHelper("compilationConstant", rootNode, new Object[0]);
        Assert.fail("Expected bailout exception because expression is not compilation constant");
    } catch (BailoutException e) {
    // Bailout exception expected.
    }
}
Also used : FrameDescriptor(com.oracle.truffle.api.frame.FrameDescriptor) NonConstantTestNode(org.graalvm.compiler.truffle.test.nodes.NonConstantTestNode) BailoutException(jdk.vm.ci.code.BailoutException) RootTestNode(org.graalvm.compiler.truffle.test.nodes.RootTestNode) Test(org.junit.Test)

Aggregations

FrameDescriptor (com.oracle.truffle.api.frame.FrameDescriptor)1 BailoutException (jdk.vm.ci.code.BailoutException)1 NonConstantTestNode (org.graalvm.compiler.truffle.test.nodes.NonConstantTestNode)1 RootTestNode (org.graalvm.compiler.truffle.test.nodes.RootTestNode)1 Test (org.junit.Test)1