src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/EnumSwitchTest.java
changeset 58299 6df94ce3ab2f
parent 52910 583fd71c47d6
child 58877 aec7bf35d6f5
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/EnumSwitchTest.java	Tue Sep 24 08:54:08 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/EnumSwitchTest.java	Tue Sep 24 12:47:15 2019 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -24,8 +24,6 @@
 
 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;
@@ -33,6 +31,8 @@
 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 {
 
@@ -145,6 +145,7 @@
         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. */