summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/537-checker-jump-over-jump/src/Main.java26
-rw-r--r--test/Android.run-test.mk14
-rwxr-xr-xtest/run-test26
3 files changed, 54 insertions, 12 deletions
diff --git a/test/537-checker-jump-over-jump/src/Main.java b/test/537-checker-jump-over-jump/src/Main.java
index fb666eaaea..cf9a69d28e 100644
--- a/test/537-checker-jump-over-jump/src/Main.java
+++ b/test/537-checker-jump-over-jump/src/Main.java
@@ -20,13 +20,25 @@ public class Main {
public static int[] fibs;
/// CHECK-START-X86_64: int Main.test() disassembly (after)
- /// CHECK: If
- /// CHECK-NEXT: cmp
- /// CHECK-NEXT: jnl/ge
- /// CHECK-NOT: jmp
- /// CHECK: ArrayGet
- // Checks that there is no conditional jump over a jmp. The ArrayGet is in
- // the next block.
+ /// CHECK-DAG: <<Zero:i\d+>> IntConstant 0
+ //
+ /// CHECK: If
+ /// CHECK-NEXT: cmp
+ /// CHECK-NEXT: jnl/ge
+ //
+ /// CHECK-DAG: <<Fibs:l\d+>> StaticFieldGet
+ /// CHECK-DAG: NullCheck [<<Fibs>>]
+ /// CHECK-NOT: jmp
+ /// CHECK-DAG: <<FibsAtZero:i\d+>> ArrayGet [<<Fibs>>,<<Zero>>]
+ /// CHECK-DAG: Return [<<FibsAtZero>>]
+ //
+ // Checks that there is no conditional jump over a `jmp`
+ // instruction. The `ArrayGet` instruction is in the next block.
+ //
+ // Note that the `StaticFieldGet` HIR instruction above (captured as
+ // `Fibs`) can produce a `jmp` x86-64 instruction when read barriers
+ // are enabled (to jump into the read barrier slow path), which is
+ // different from the `jmp` in the `CHECK-NOT` assertion.
public static int test() {
for (int i = 1; ; i++) {
if (i >= FIBCOUNT) {
diff --git a/test/Android.run-test.mk b/test/Android.run-test.mk
index 60b65911f9..8bd5f9fb75 100644
--- a/test/Android.run-test.mk
+++ b/test/Android.run-test.mk
@@ -497,14 +497,20 @@ endif
TEST_ART_BROKEN_OPTIMIZING_DEBUGGABLE_RUN_TESTS :=
# Tests that should fail in the read barrier configuration.
+# 055: Exceeds run time limits due to read barrier instrumentation.
# 137: Read barrier forces interpreter. Cannot run this with the interpreter.
+# 537: Expects an array copy to be intrinsified, but calling-on-slowpath intrinsics are not yet
+# handled in the read barrier configuration.
TEST_ART_BROKEN_READ_BARRIER_RUN_TESTS := \
- 137-cfi \
+ 055-enum-performance \
+ 137-cfi \
+ 537-checker-arraycopy
ifeq ($(ART_USE_READ_BARRIER),true)
- ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),$(PREBUILD_TYPES), \
- $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \
- $(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_READ_BARRIER_RUN_TESTS),$(ALL_ADDRESS_SIZES))
+ ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES), \
+ $(PREBUILD_TYPES),$(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES), \
+ $(JNI_TYPES),$(IMAGE_TYPES),$(PICTEST_TYPES),$(DEBUGGABLE_TYPES), \
+ $(TEST_ART_BROKEN_READ_BARRIER_RUN_TESTS),$(ALL_ADDRESS_SIZES))
endif
TEST_ART_BROKEN_READ_BARRIER_RUN_TESTS :=
diff --git a/test/run-test b/test/run-test
index b2f6546cb7..10ec3103b9 100755
--- a/test/run-test
+++ b/test/run-test
@@ -665,6 +665,15 @@ chmod 755 "$check_cmd"
export TEST_NAME=`basename ${test_dir}`
+# arch_supports_read_barrier ARCH
+# -------------------------------
+# Return whether the Optimizing compiler has read barrier support for ARCH.
+function arch_supports_read_barrier() {
+ # Optimizing has read barrier support for x86 and x86-64 at the
+ # moment.
+ [ "x$1" = xx86 ] || [ "x$1" = xx86_64 ]
+}
+
# Tests named '<number>-checker-*' will also have their CFGs verified with
# Checker when compiled with Optimizing on host.
if [[ "$TEST_NAME" =~ ^[0-9]+-checker- ]]; then
@@ -678,9 +687,24 @@ if [[ "$TEST_NAME" =~ ^[0-9]+-checker- ]]; then
USE_JACK="false"
if [ "$runtime" = "art" -a "$image_suffix" = "-optimizing" ]; then
+ # Optimizing has read barrier support for certain architectures
+ # only. On other architectures, compiling is disabled when read
+ # barriers are enabled, meaning that we do not produce a CFG file
+ # as a side-effect of compilation, thus the Checker assertions
+ # cannot be checked. Disable Checker for those cases.
+ #
+ # TODO: Enable Checker when read barrier support is added to more
+ # architectures (b/12687968).
+ if [ "x$ART_USE_READ_BARRIER" = xtrue ] \
+ && (([ "x$host_mode" = "xyes" ] \
+ && ! arch_supports_read_barrier "$host_arch_name") \
+ || ([ "x$target_mode" = "xyes" ] \
+ && ! arch_supports_read_barrier "$target_arch_name")); then
+ run_checker="no"
# In no-prebuild mode, the compiler is only invoked if both dex2oat and
# patchoat are available. Disable Checker otherwise (b/22552692).
- if [ "$prebuild_mode" = "yes" ] || [ "$have_patchoat" = "yes" -a "$have_dex2oat" = "yes" ]; then
+ elif [ "$prebuild_mode" = "yes" ] \
+ || [ "$have_patchoat" = "yes" -a "$have_dex2oat" = "yes" ]; then
run_checker="yes"
if [ "$target_mode" = "no" ]; then