annotate test/compiler/native/libTestDirtyInt.c @ 10330:1f4f4866aee0

8148353: [linux-sparc] Crash in libawt.so on Linux SPARC Summary: gcc expects clean 32 bit int in 64 bit register on function entry Reviewed-by: kvn, dlong
author roland
date Tue, 23 Feb 2016 17:18:31 +0100
parents
children
rev   line source
roland@10330 1 /*
roland@10330 2 * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
roland@10330 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
roland@10330 4 *
roland@10330 5 * This code is free software; you can redistribute it and/or modify it
roland@10330 6 * under the terms of the GNU General Public License version 2 only, as
roland@10330 7 * published by the Free Software Foundation.
roland@10330 8 *
roland@10330 9 * This code is distributed in the hope that it will be useful, but WITHOUT
roland@10330 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
roland@10330 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
roland@10330 12 * version 2 for more details (a copy is included in the LICENSE file that
roland@10330 13 * accompanied this code).
roland@10330 14 *
roland@10330 15 * You should have received a copy of the GNU General Public License version
roland@10330 16 * 2 along with this work; if not, write to the Free Software Foundation,
roland@10330 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
roland@10330 18 *
roland@10330 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
roland@10330 20 * or visit www.oracle.com if you need additional information or have any
roland@10330 21 * questions.
roland@10330 22 */
roland@10330 23
roland@10330 24 #include "jni.h"
roland@10330 25 #include <stdio.h>
roland@10330 26
roland@10330 27 static int array = 0x42;
roland@10330 28
roland@10330 29 JNIEXPORT jint JNICALL Java_TestDirtyInt_test(JNIEnv* env, jclass jclazz, jint v)
roland@10330 30 {
roland@10330 31 int* ptr = &array + v + 4;
roland@10330 32 return *ptr;
roland@10330 33 }