Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/test/gc/shenandoah/jni/TestCriticalNativeStress.sh
32285 views
#!/bin/sh12#3# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.4# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.5#6# This code is free software; you can redistribute it and/or modify it7# under the terms of the GNU General Public License version 2 only, as8# published by the Free Software Foundation.9#10# This code is distributed in the hope that it will be useful, but WITHOUT11# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13# version 2 for more details (a copy is included in the LICENSE file that14# accompanied this code).15#16# You should have received a copy of the GNU General Public License version17# 2 along with this work; if not, write to the Free Software Foundation,18# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19#20# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21# or visit www.oracle.com if you need additional information or have any22# questions.23#2425##26## @test27## @requires (os.arch == "x86_64" | os.arch == "amd64" | os.arch=="x86" | os.arch=="i386")28## @summary test JNI critical arrays support in Shenandoah29## @run shell/timeout=480 TestCriticalNativeStress.sh30##3132if [ "${TESTSRC}" = "" ]33then34TESTSRC=${PWD}35echo "TESTSRC not set. Using "${TESTSRC}" as default"36fi37echo "TESTSRC=${TESTSRC}"38## Adding common setup Variables for running shell tests.39. ${TESTSRC}/../../../test_env.sh4041# set platform-dependent variables42if [ "$VM_OS" = "linux" ]; then43echo "Testing on linux"44gcc_cmd=`which gcc`45if [ "x$gcc_cmd" = "x" ]; then46echo "WARNING: gcc not found. Cannot execute test." 2>&147exit 0;48fi49else50echo "Test passed; only valid for linux: $VM_OS"51exit 0;52fi535455THIS_DIR=.5657cp ${TESTSRC}${FS}*.java ${THIS_DIR}58${TESTJAVA}${FS}bin${FS}javac TestCriticalNativeStress.java5960# default target 64-bits61GCC_TARGET_BITS=""62if [ "$VM_BITS" = "32" ]; then63GCC_TARGET_BITS="-m32"64fi6566$gcc_cmd -O1 -DLINUX -fPIC -shared ${GCC_TARGET_BITS} \67-o ${THIS_DIR}${FS}libTestCriticalNative.so \68-I${TESTJAVA}${FS}include \69-I${TESTJAVA}${FS}include${FS}linux \70${TESTSRC}${FS}libTestCriticalNative.c7172# run the java test in the background7374cmd="${TESTJAVA}${FS}bin${FS}java -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCMode=passive -XX:+ShenandoahDegeneratedGC -Xcomp -Xmx512M -XX:+CriticalJNINatives \75-Djava.library.path=${THIS_DIR}${FS} TestCriticalNativeStress"7677echo "$cmd"78eval $cmd7980if [ $? -ne 0 ]81then82echo "Test Failed"83exit 184fi8586cmd="${TESTJAVA}${FS}bin${FS}java -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCMode=passive -XX:-ShenandoahDegeneratedGC -Xcomp -Xmx512M -XX:+CriticalJNINatives \87-Djava.library.path=${THIS_DIR}${FS} TestCriticalNativeStress"8889echo "$cmd"90eval $cmd9192if [ $? -ne 0 ]93then94echo "Test Failed"95exit 196fi9798cmd="${TESTJAVA}${FS}bin${FS}java -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xcomp -Xmx256M -XX:+CriticalJNINatives \99-Djava.library.path=${THIS_DIR}${FS} TestCriticalNativeStress"100101echo "$cmd"102eval $cmd103104if [ $? -ne 0 ]105then106echo "Test Failed"107exit 1108fi109110cmd="${TESTJAVA}${FS}bin${FS}java -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive -Xcomp -Xmx512M -XX:+CriticalJNINatives \111-Djava.library.path=${THIS_DIR}${FS} TestCriticalNativeStress"112113echo "$cmd"114eval $cmd115116if [ $? -ne 0 ]117then118echo "Test Failed"119exit 1120fi121122123124