changeset 21047:61730e3a9dce

added disabled test demonstrating bug in arraycopy snippets
author Doug Simon <doug.simon@oracle.com>
date Mon, 20 Apr 2015 19:08:56 +0200
parents d35d2ac04970
children 013a466838b9
files graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/ArrayCopyIntrinsificationTest.java
diffstat 1 files changed, 21 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/ArrayCopyIntrinsificationTest.java	Mon Apr 20 19:07:49 2015 +0200
+++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/ArrayCopyIntrinsificationTest.java	Mon Apr 20 19:08:56 2015 +0200
@@ -251,4 +251,25 @@
         return dst;
     }
 
+    /**
+     * Test case derived from assertion while compiling <a href=
+     * "https://code.google.com/r/baggiogamp-guava/source/browse/guava/src/com/google/common/collect/ArrayTable.java?r=d2e06112416223cb5437d43c12a989c0adc7345b#181"
+     * > com.google.common.collect.ArrayTable(ArrayTable other)</a>.
+     */
+    @Ignore
+    @Test
+    public void testCopyRows() {
+        mustIntrinsify = false;
+        Object[][] rows = {{"a1", "a2", "a3", "a4"}, {"b1", "b2", "b3", "b4"}, {"c1", "c2", "c3", "c4"}};
+        test("copyRows", rows, 4, new Integer(rows.length));
+        mustIntrinsify = true;
+    }
+
+    public static Object[][] copyRows(Object[][] rows, int rowSize, Integer rowCount) {
+        Object[][] copy = new Object[rows.length][rowSize];
+        for (int i = 0; i < rowCount.intValue(); i++) {
+            System.arraycopy(rows[i], 0, copy[i], 0, rows[i].length);
+        }
+        return copy;
+    }
 }