summaryrefslogtreecommitdiff
path: root/test/011-array-copy/src/Main.java
diff options
context:
space:
mode:
author Andreas Gampe <agampe@google.com> 2015-07-16 17:41:25 -0700
committer Andreas Gampe <agampe@google.com> 2015-07-16 17:41:25 -0700
commitc952ac905442a08b51af1f336f803fa221bd23d2 (patch)
tree1919b60412a0aaa50c1fe971d4f016e86a16ef67 /test/011-array-copy/src/Main.java
parent6d3d1e3d866a880b4df95ba96ed126c1723e3dd6 (diff)
ART: Fix System.arraycopy
We cannot use the same code for float+int and long+double. In debug mode, this will fail. Change-Id: Icf263626896a7b53e59685c474e77b4c3128ecd5
Diffstat (limited to 'test/011-array-copy/src/Main.java')
-rw-r--r--test/011-array-copy/src/Main.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/011-array-copy/src/Main.java b/test/011-array-copy/src/Main.java
index 505d8b09ce..96e1dbf21a 100644
--- a/test/011-array-copy/src/Main.java
+++ b/test/011-array-copy/src/Main.java
@@ -23,6 +23,7 @@ public class Main {
public static void main(String args[]) {
testObjectCopy();
testOverlappingMoves();
+ testFloatAndDouble();
}
public static void testObjectCopy() {
@@ -143,4 +144,13 @@ public class Main {
/* copy forward, mixed alignment, trivial length */
makeCopies(0, 5, 1);
}
+
+ private static void testFloatAndDouble() {
+ // Float & double copies have the same implementation as int & long. However, there are
+ // protective DCHECKs in the code (there is nothing unifying like ByteSizedArray or
+ // ShortSizedArray). Just test that we don't fail those checks.
+ final int len = 10;
+ System.arraycopy(new float[len], 0, new float[len], 0, len);
+ System.arraycopy(new double[len], 0, new double[len], 0, len);
+ }
}