summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/457-regs/expected.txt1
-rw-r--r--test/457-regs/run26
-rw-r--r--test/457-regs/src/Main.java12
3 files changed, 39 insertions, 0 deletions
diff --git a/test/457-regs/expected.txt b/test/457-regs/expected.txt
index 6a5618ebc6..8db7853696 100644
--- a/test/457-regs/expected.txt
+++ b/test/457-regs/expected.txt
@@ -1 +1,2 @@
JNI_OnLoad called
+JNI_OnLoad called
diff --git a/test/457-regs/run b/test/457-regs/run
new file mode 100644
index 0000000000..2591855677
--- /dev/null
+++ b/test/457-regs/run
@@ -0,0 +1,26 @@
+#!/bin/bash
+#
+# Copyright (C) 2020 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+${RUN} "$@"
+return_status1=$?
+
+# Force baseline JIT compilation as the test explicitly requests JIT
+# compilation, which by default is 'optimizing'.
+${RUN} "$@" -Xcompiler-option --baseline
+return_status2=$?
+
+# Make sure we don't silently ignore an early failure.
+(exit $return_status1) && (exit $return_status2)
diff --git a/test/457-regs/src/Main.java b/test/457-regs/src/Main.java
index 3b8df443ff..428c91301f 100644
--- a/test/457-regs/src/Main.java
+++ b/test/457-regs/src/Main.java
@@ -27,17 +27,29 @@ public class Main {
Class<?> c = Class.forName("PhiLiveness");
Method m = c.getMethod("mergeOk", boolean.class, byte.class);
m.invoke(null, new Boolean(true), new Byte((byte)2));
+ ensureMethodJitCompiled(m);
+ m.invoke(null, new Boolean(true), new Byte((byte)2));
m = c.getMethod("mergeNotOk", boolean.class, float.class);
m.invoke(null, new Boolean(true), new Float(4.0f));
+ ensureMethodJitCompiled(m);
+ m.invoke(null, new Boolean(true), new Float(4.0f));
m = c.getMethod("mergeReferences", Main.class);
m.invoke(null, new Main());
+ ensureMethodJitCompiled(m);
+ m.invoke(null, new Main());
m = c.getMethod("phiEquivalent");
m.invoke(null);
+ ensureMethodJitCompiled(m);
+ m.invoke(null);
m = c.getMethod("phiAllEquivalents", Main.class);
m.invoke(null, new Main());
+ ensureMethodJitCompiled(m);
+ m.invoke(null, new Main());
}
+
+ public native static void ensureMethodJitCompiled(Method method);
}