# HG changeset patch # User Christos Kotselidis # Date 1375443904 -7200 # Node ID ed315765a43a9c055197d430f9ad16cbf84f064c # Parent 56a86b60c9d30ced789451c5907b839c52cd80d8 Add more unittests for ArrayCopy write barriers diff -r 56a86b60c9d3 -r ed315765a43a graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/WriteBarrierAdditionTest.java --- a/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/WriteBarrierAdditionTest.java Fri Aug 02 13:43:15 2013 +0200 +++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/WriteBarrierAdditionTest.java Fri Aug 02 13:45:04 2013 +0200 @@ -207,6 +207,27 @@ test2("testUnsafeLoad", wr, new Long(16), new Integer(16)); } + static Object[] src = new Object[1]; + static Object[] dst = new Object[1]; + + static { + for (int i = 0; i < src.length; i++) { + src[i] = new Object(); + } + for (int i = 0; i < dst.length; i++) { + dst[i] = new Object(); + } + } + + public static void testArrayCopy(Object a, Object b, Object c) throws Exception { + System.arraycopy(a, 0, b, 0, (int) c); + } + + @Test + public void test11() throws Exception { + test2("testArrayCopy", src, dst, dst.length); + } + public static Object testUnsafeLoad(Object a, Object b, Object c) throws Exception { final int offset = (c == null ? 0 : ((Integer) c).intValue()); final long displacement = (b == null ? 0 : ((Long) b).longValue());