< prev index next >

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/OpaqueDirectiveTest.java

Print this page

        

*** 35,44 **** --- 35,47 ---- import org.graalvm.compiler.nodes.ConstantNode; import org.graalvm.compiler.nodes.ReturnNode; import org.graalvm.compiler.nodes.StructuredGraph; import org.graalvm.compiler.nodes.calc.AddNode; import org.graalvm.compiler.nodes.calc.ConditionalNode; + import org.graalvm.compiler.phases.OptimisticOptimizations; + import org.graalvm.compiler.phases.OptimisticOptimizations.Optimization; + import org.graalvm.compiler.phases.tiers.HighTierContext; /** * Tests for {@link GraalDirectives#opaque}. * * There are two snippets for each kind:
*** 126,135 **** --- 129,143 ---- test("objectSnippet"); test("opaqueObjectSnippet"); } @Override + protected HighTierContext getDefaultHighTierContext() { + return new HighTierContext(getProviders(), getDefaultGraphBuilderSuite(), OptimisticOptimizations.ALL.remove(Optimization.RemoveNeverExecutedCode)); + } + + @Override protected boolean checkLowTierGraph(StructuredGraph graph) { OpaqueSnippet snippet = graph.method().getAnnotation(OpaqueSnippet.class); for (ReturnNode returnNode : graph.getNodes(ReturnNode.TYPE)) { Assert.assertEquals(snippet.expectedReturnNode(), returnNode.result().getClass()); }
< prev index next >