# HG changeset patch # User Doug Simon # Date 1429549736 -7200 # Node ID 61730e3a9dce7f0835cd9fe18644d9eaa507b61b # Parent d35d2ac04970cb9eb52e456112b332a3bfe5f6d9 added disabled test demonstrating bug in arraycopy snippets diff -r d35d2ac04970 -r 61730e3a9dce graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/ArrayCopyIntrinsificationTest.java --- 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 com.google.common.collect.ArrayTable(ArrayTable other). + */ + @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; + } }