summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/706-checker-scheduler/expected.txt0
-rw-r--r--test/706-checker-scheduler/info.txt1
-rw-r--r--test/706-checker-scheduler/src/Main.java82
-rw-r--r--test/Android.run-test.mk5
4 files changed, 86 insertions, 2 deletions
diff --git a/test/706-checker-scheduler/expected.txt b/test/706-checker-scheduler/expected.txt
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/test/706-checker-scheduler/expected.txt
diff --git a/test/706-checker-scheduler/info.txt b/test/706-checker-scheduler/info.txt
new file mode 100644
index 0000000000..b4ad9b4378
--- /dev/null
+++ b/test/706-checker-scheduler/info.txt
@@ -0,0 +1 @@
+Tests for HInstruction scheduler.
diff --git a/test/706-checker-scheduler/src/Main.java b/test/706-checker-scheduler/src/Main.java
new file mode 100644
index 0000000000..1721e4294e
--- /dev/null
+++ b/test/706-checker-scheduler/src/Main.java
@@ -0,0 +1,82 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+public class Main {
+
+ static int static_variable = 0;
+
+ /// CHECK-START-ARM64: int Main.arrayAccess() scheduler (before)
+ /// CHECK: <<Const1:i\d+>> IntConstant 1
+ /// CHECK: <<i0:i\d+>> Phi
+ /// CHECK: <<res0:i\d+>> Phi
+ /// CHECK: <<Array:i\d+>> IntermediateAddress
+ /// CHECK: <<ArrayGet1:i\d+>> ArrayGet [<<Array>>,<<i0>>]
+ /// CHECK: <<res1:i\d+>> Add [<<res0>>,<<ArrayGet1>>]
+ /// CHECK: <<i1:i\d+>> Add [<<i0>>,<<Const1>>]
+ /// CHECK: <<ArrayGet2:i\d+>> ArrayGet [<<Array>>,<<i1>>]
+ /// CHECK: Add [<<res1>>,<<ArrayGet2>>]
+
+ /// CHECK-START-ARM64: int Main.arrayAccess() scheduler (after)
+ /// CHECK: <<Const1:i\d+>> IntConstant 1
+ /// CHECK: <<i0:i\d+>> Phi
+ /// CHECK: <<res0:i\d+>> Phi
+ /// CHECK: <<Array:i\d+>> IntermediateAddress
+ /// CHECK: <<ArrayGet1:i\d+>> ArrayGet [<<Array>>,<<i0>>]
+ /// CHECK: <<i1:i\d+>> Add [<<i0>>,<<Const1>>]
+ /// CHECK: <<ArrayGet2:i\d+>> ArrayGet [<<Array>>,<<i1>>]
+ /// CHECK: <<res1:i\d+>> Add [<<res0>>,<<ArrayGet1>>]
+ /// CHECK: Add [<<res1>>,<<ArrayGet2>>]
+
+ public static int arrayAccess() {
+ int res = 0;
+ int [] array = new int[10];
+ for (int i = 0; i < 9; i++) {
+ res += array[i];
+ res += array[i + 1];
+ }
+ return res;
+ }
+
+ /// CHECK-START-ARM64: int Main.intDiv(int) scheduler (before)
+ /// CHECK: Sub
+ /// CHECK: DivZeroCheck
+ /// CHECK: Div
+ /// CHECK: StaticFieldSet
+
+ /// CHECK-START-ARM64: int Main.intDiv(int) scheduler (after)
+ /// CHECK: Sub
+ /// CHECK-NOT: StaticFieldSet
+ /// CHECK: DivZeroCheck
+ /// CHECK-NOT: Sub
+ /// CHECK: Div
+ public static int intDiv(int arg) {
+ int res = 0;
+ int tmp = arg;
+ for (int i = 1; i < arg; i++) {
+ tmp -= i;
+ res = res / i; // div-zero check barrier.
+ static_variable++;
+ }
+ res += tmp;
+ return res;
+ }
+
+ public static void main(String[] args) {
+ if ((arrayAccess() + intDiv(10)) != -35) {
+ System.out.println("FAIL");
+ }
+ }
+}
diff --git a/test/Android.run-test.mk b/test/Android.run-test.mk
index 1b4f19509f..742353da46 100644
--- a/test/Android.run-test.mk
+++ b/test/Android.run-test.mk
@@ -439,13 +439,14 @@ TEST_ART_BROKEN_FALLBACK_RUN_TESTS := \
629-vdex-speed
# This test fails without an image.
-# 018, 961, 964 often time out. b/34369284
+# 018, 961, 964, 968 often time out. b/34369284
TEST_ART_BROKEN_NO_IMAGE_RUN_TESTS := \
137-cfi \
138-duplicate-classes-check \
018-stack-overflow \
961-default-iface-resolution-gen \
- 964-default-iface-init
+ 964-default-iface-init \
+ 968-default-partial-compile-gen \
ifneq (,$(filter no-dex2oat,$(PREBUILD_TYPES)))
ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),$(RUN_TYPES),no-dex2oat, \