1060N/A/*
1472N/A * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
1060N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1060N/A *
1060N/A * This code is free software; you can redistribute it and/or modify it
1060N/A * under the terms of the GNU General Public License version 2 only, as
1060N/A * published by the Free Software Foundation.
1060N/A *
1060N/A * This code is distributed in the hope that it will be useful, but WITHOUT
1060N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1060N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1060N/A * version 2 for more details (a copy is included in the LICENSE file that
1060N/A * accompanied this code).
1060N/A *
1060N/A * You should have received a copy of the GNU General Public License version
1060N/A * 2 along with this work; if not, write to the Free Software Foundation,
1060N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1060N/A *
1472N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
1472N/A * or visit www.oracle.com if you need additional information or have any
1472N/A * questions.
1060N/A *
1060N/A */
1060N/A
1060N/A/**
1060N/A * @test
1060N/A * @bug 6769124
1060N/A * @summary arraycopy may crash the VM with c1 on 64 bit
1060N/A */
1060N/A
1060N/Apublic class TestArrayCopy6769124 {
1060N/A
1060N/A public static void main(String[] args) {
1060N/A
1060N/A int k = 1 << 31;
1060N/A
1060N/A
1060N/A for(int j = 0; j <1000000; j++) {
1060N/A int i = -1;
1060N/A while(i < 10) {
1060N/A i++;
1060N/A }
1060N/A
1060N/A int m = k * i;
1060N/A
1060N/A int[] O1 = new int[20];
1060N/A int[] O2 = new int[20];
1060N/A
1060N/A System.arraycopy(O1, i, O2, i, 1); //will crash on amd64
1060N/A System.arraycopy(O1, m, O2, m, 1); //will crash on sparcv9
1060N/A }
1060N/A }
1060N/A}