use of org.graalvm.compiler.truffle.test.nodes.NeverPartOfCompilationTestNode in project graal by oracle.
the class SimplePartialEvaluationTest method neverPartOfCompilationTest.
@Test
public void neverPartOfCompilationTest() {
FrameDescriptor fd = new FrameDescriptor();
AbstractTestNode firstTree = new NeverPartOfCompilationTestNode(new ConstantTestNode(1), 2);
assertPartialEvalEquals("constant42", new RootTestNode(fd, "neverPartOfCompilationTest", firstTree));
AbstractTestNode secondTree = new NeverPartOfCompilationTestNode(new ConstantTestNode(1), 1);
try {
assertPartialEvalEquals("constant42", new RootTestNode(fd, "neverPartOfCompilationTest", secondTree));
Assert.fail("Expected verification error!");
} catch (SourceStackTraceBailoutException t) {
// Expected verification error occurred.
StackTraceElement[] trace = t.getStackTrace();
assertStack(trace[0], "org.graalvm.compiler.truffle.test.nodes.NeverPartOfCompilationTestNode", "execute", "NeverPartOfCompilationTestNode.java");
if (!truffleCompiler.getPartialEvaluator().getConfigForParsing().trackNodeSourcePosition() && !GraalOptions.TrackNodeSourcePosition.getValue(getInitialOptions())) {
assertStack(trace[1], "org.graalvm.compiler.truffle.test.nodes.RootTestNode", "execute", "RootTestNode.java");
} else {
// When NodeSourcePosition tracking is enabled, a smaller stack trace is produced
}
}
}
Aggregations