comparison graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/StraighteningTest.java @ 19250:8ab925a6f724

made Assumptions be part of a StructuredGraph
author Doug Simon <doug.simon@oracle.com>
date Wed, 11 Feb 2015 10:13:08 +0100
parents 1668de777c42
children a0a760b0fb5f
comparison
equal deleted inserted replaced
19249:ec8402f4e00a 19250:8ab925a6f724
20 * or visit www.oracle.com if you need additional information or have any 20 * or visit www.oracle.com if you need additional information or have any
21 * questions. 21 * questions.
22 */ 22 */
23 package com.oracle.graal.compiler.test; 23 package com.oracle.graal.compiler.test;
24 24
25 import static com.oracle.graal.api.code.Assumptions.*;
26
25 import org.junit.*; 27 import org.junit.*;
26 28
27 import com.oracle.graal.api.code.*;
28 import com.oracle.graal.debug.*; 29 import com.oracle.graal.debug.*;
29 import com.oracle.graal.nodes.*; 30 import com.oracle.graal.nodes.*;
30 import com.oracle.graal.phases.common.*; 31 import com.oracle.graal.phases.common.*;
31 import com.oracle.graal.phases.tiers.*; 32 import com.oracle.graal.phases.tiers.*;
32 33
85 test("test3Snippet"); 86 test("test3Snippet");
86 } 87 }
87 88
88 private void test(final String snippet) { 89 private void test(final String snippet) {
89 // No debug scope to reduce console noise for @Test(expected = ...) tests 90 // No debug scope to reduce console noise for @Test(expected = ...) tests
90 StructuredGraph graph = parseEager(snippet); 91 StructuredGraph graph = parseEager(snippet, ALLOW_OPTIMISTIC_ASSUMPTIONS);
91 Debug.dump(graph, "Graph"); 92 Debug.dump(graph, "Graph");
92 new CanonicalizerPhase(true).apply(graph, new PhaseContext(getProviders(), new Assumptions(false))); 93 new CanonicalizerPhase(true).apply(graph, new PhaseContext(getProviders()));
93 StructuredGraph referenceGraph = parseEager(REFERENCE_SNIPPET); 94 StructuredGraph referenceGraph = parseEager(REFERENCE_SNIPPET, ALLOW_OPTIMISTIC_ASSUMPTIONS);
94 assertEquals(referenceGraph, graph); 95 assertEquals(referenceGraph, graph);
95 } 96 }
96 } 97 }