summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorNicolas Geoffray <ngeoffray@google.com>2015-01-14 10:31:28 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-01-14 10:31:29 +0000
commitc208b8776eac5ab2d656eda1c5ede90d2cc795a2 (patch)
treea2359060c57423bb35da15408af2fa7e628714bf /test
parentc40a4350daac81ddbfc5f6ceab934f2180dc4ec6 (diff)
parent53f1262773516a247e7bfad50de3cd94a4dcf4df (diff)
downloadart-c208b8776eac5ab2d656eda1c5ede90d2cc795a2.tar.gz
art-c208b8776eac5ab2d656eda1c5ede90d2cc795a2.tar.bz2
art-c208b8776eac5ab2d656eda1c5ede90d2cc795a2.zip
Merge "Implement ParallelMoveResolver::Swap for doubles on arm."
Diffstat (limited to 'test')
-rw-r--r--test/439-swap-double/expected.txt4
-rw-r--r--test/439-swap-double/info.txt2
-rw-r--r--test/439-swap-double/src/Main.java46
3 files changed, 52 insertions, 0 deletions
diff --git a/test/439-swap-double/expected.txt b/test/439-swap-double/expected.txt
new file mode 100644
index 0000000000..019c90149e
--- /dev/null
+++ b/test/439-swap-double/expected.txt
@@ -0,0 +1,4 @@
+-26.0
+-24.0
+-22.0
+-20.0
diff --git a/test/439-swap-double/info.txt b/test/439-swap-double/info.txt
new file mode 100644
index 0000000000..23447d2b12
--- /dev/null
+++ b/test/439-swap-double/info.txt
@@ -0,0 +1,2 @@
+Test for the optimizing compiler's parallel swap support in
+the presence of register pairs (in this case, doubles on ARM).
diff --git a/test/439-swap-double/src/Main.java b/test/439-swap-double/src/Main.java
new file mode 100644
index 0000000000..da11577e25
--- /dev/null
+++ b/test/439-swap-double/src/Main.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2015 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.
+ */
+
+// Test for the optimizing compiler's parallel swap support in
+// the presence of register pairs (in this case, doubles on ARM).
+public class Main {
+ public static void main(String[] args) {
+ new Main().foo();
+ }
+
+ public void foo() {
+ // Do multiple calls to force swapping of registers. Note that
+ // this depends on the calling convention, as a stack-only convention
+ // may not need the swapping.
+ callWithDoubles(a, b, c, d, e, f, g);
+ callWithDoubles(b, c, d, e, f, g, a);
+ callWithDoubles(c, d, e, f, g, a, b);
+ callWithDoubles(d, e, f, g, a, b, c);
+ }
+
+ public static void callWithDoubles(
+ double a, double b, double c, double d, double e, double f, double g) {
+ System.out.println(a - b - c - d - e - f - g);
+ }
+
+ double a = 1.0;
+ double b = 2.0;
+ double c = 3.0;
+ double d = 4.0;
+ double e = 5.0;
+ double f = 6.0;
+ double g = 7.0;
+}