src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/LoopUnswitchTest.java
equal
deleted
inserted
replaced
29 import org.graalvm.compiler.loop.DefaultLoopPolicies; |
29 import org.graalvm.compiler.loop.DefaultLoopPolicies; |
30 import org.graalvm.compiler.loop.phases.LoopUnswitchingPhase; |
30 import org.graalvm.compiler.loop.phases.LoopUnswitchingPhase; |
31 import org.graalvm.compiler.nodes.StructuredGraph; |
31 import org.graalvm.compiler.nodes.StructuredGraph; |
32 import org.graalvm.compiler.nodes.StructuredGraph.AllowAssumptions; |
32 import org.graalvm.compiler.nodes.StructuredGraph.AllowAssumptions; |
33 import org.graalvm.compiler.phases.common.CanonicalizerPhase; |
33 import org.graalvm.compiler.phases.common.CanonicalizerPhase; |
34 import org.graalvm.compiler.phases.tiers.PhaseContext; |
|
35 import org.junit.Test; |
34 import org.junit.Test; |
36 |
35 |
37 public class LoopUnswitchTest extends GraalCompilerTest { |
36 public class LoopUnswitchTest extends GraalCompilerTest { |
38 |
37 |
39 public static int referenceSnippet1(int a) { |
38 public static int referenceSnippet1(int a) { |
132 |
131 |
133 // Framestates create comparison problems |
132 // Framestates create comparison problems |
134 graph.clearAllStateAfter(); |
133 graph.clearAllStateAfter(); |
135 referenceGraph.clearAllStateAfter(); |
134 referenceGraph.clearAllStateAfter(); |
136 |
135 |
137 new CanonicalizerPhase().apply(graph, new PhaseContext(getProviders())); |
136 new CanonicalizerPhase().apply(graph, getProviders()); |
138 new CanonicalizerPhase().apply(referenceGraph, new PhaseContext(getProviders())); |
137 new CanonicalizerPhase().apply(referenceGraph, getProviders()); |
139 try (DebugContext.Scope s = debug.scope("Test", new DebugDumpScope("Test:" + snippet))) { |
138 try (DebugContext.Scope s = debug.scope("Test", new DebugDumpScope("Test:" + snippet))) { |
140 assertEquals(referenceGraph, graph); |
139 assertEquals(referenceGraph, graph); |
141 } catch (Throwable e) { |
140 } catch (Throwable e) { |
142 throw debug.handle(e); |
141 throw debug.handle(e); |
143 } |
142 } |