< prev index next >

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/EnumSwitchTest.java

Print this page
rev 56282 : [mq]: graal

*** 1,7 **** /* ! * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 22,40 **** */ package org.graalvm.compiler.core.test; - import org.junit.Test; - import org.graalvm.compiler.nodes.StructuredGraph; import org.graalvm.compiler.nodes.extended.IntegerSwitchNode; import org.graalvm.compiler.nodes.java.LoadIndexedNode; import org.graalvm.compiler.options.OptionValues; import org.graalvm.compiler.phases.Phase; import org.graalvm.compiler.phases.common.RemoveValueProxyPhase; import org.graalvm.compiler.phases.tiers.Suites; public class EnumSwitchTest extends GraalCompilerTest { enum E { E0, --- 22,40 ---- */ package org.graalvm.compiler.core.test; import org.graalvm.compiler.nodes.StructuredGraph; import org.graalvm.compiler.nodes.extended.IntegerSwitchNode; import org.graalvm.compiler.nodes.java.LoadIndexedNode; import org.graalvm.compiler.options.OptionValues; import org.graalvm.compiler.phases.Phase; import org.graalvm.compiler.phases.common.RemoveValueProxyPhase; import org.graalvm.compiler.phases.tiers.Suites; + import org.junit.Assume; + import org.junit.Test; public class EnumSwitchTest extends GraalCompilerTest { enum E { E0,
*** 143,152 **** --- 143,153 ---- protected Suites createSuites(OptionValues options) { Suites ret = super.createSuites(options); ret.getHighTier().prependPhase(new Phase() { @Override protected void run(StructuredGraph graph) { + Assume.assumeTrue(graph.getNodes().filter(LoadIndexedNode.class).first().array().isConstant()); /* Array load from the enum switch map. */ assertTrue(graph.getNodes().filter(LoadIndexedNode.class).count() == 1); /* The actual switch. */ assertTrue(graph.getNodes().filter(IntegerSwitchNode.class).count() == 1); }
< prev index next >