src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ScalarTypeSystemTest.java
branchdatagramsocketimpl-branch
changeset 58678 9cf78a70fa4f
parent 52910 583fd71c47d6
child 58679 9c3209ff7550
equal deleted inserted replaced
58677:13588c901957 58678:9cf78a70fa4f
     1 /*
     1 /*
     2  * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    25 package org.graalvm.compiler.core.test;
    25 package org.graalvm.compiler.core.test;
    26 
    26 
    27 import org.graalvm.compiler.debug.DebugContext;
    27 import org.graalvm.compiler.debug.DebugContext;
    28 import org.graalvm.compiler.nodes.StructuredGraph;
    28 import org.graalvm.compiler.nodes.StructuredGraph;
    29 import org.graalvm.compiler.nodes.StructuredGraph.AllowAssumptions;
    29 import org.graalvm.compiler.nodes.StructuredGraph.AllowAssumptions;
       
    30 import org.graalvm.compiler.nodes.spi.CoreProviders;
    30 import org.graalvm.compiler.phases.common.CanonicalizerPhase;
    31 import org.graalvm.compiler.phases.common.CanonicalizerPhase;
    31 import org.graalvm.compiler.phases.tiers.PhaseContext;
       
    32 import org.junit.Test;
    32 import org.junit.Test;
    33 
    33 
    34 /**
    34 /**
    35  * In the following tests, the scalar type system of the compiler should be complete enough to see
    35  * In the following tests, the scalar type system of the compiler should be complete enough to see
    36  * the relation between the different conditions.
    36  * the relation between the different conditions.
   131 
   131 
   132     private void test(final String snippet, final String referenceSnippet) {
   132     private void test(final String snippet, final String referenceSnippet) {
   133         // No debug scope to reduce console noise for @Test(expected = ...) tests
   133         // No debug scope to reduce console noise for @Test(expected = ...) tests
   134         StructuredGraph graph = parseEager(snippet, AllowAssumptions.NO);
   134         StructuredGraph graph = parseEager(snippet, AllowAssumptions.NO);
   135         graph.getDebug().dump(DebugContext.BASIC_LEVEL, graph, "Graph");
   135         graph.getDebug().dump(DebugContext.BASIC_LEVEL, graph, "Graph");
   136         PhaseContext context = new PhaseContext(getProviders());
   136         CoreProviders context = getProviders();
   137         new CanonicalizerPhase().apply(graph, context);
   137         new CanonicalizerPhase().apply(graph, context);
   138         StructuredGraph referenceGraph = parseEager(referenceSnippet, AllowAssumptions.NO);
   138         StructuredGraph referenceGraph = parseEager(referenceSnippet, AllowAssumptions.NO);
   139         assertEquals(referenceGraph, graph);
   139         assertEquals(referenceGraph, graph);
   140     }
   140     }
   141 }
   141 }