Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/test/gc/shenandoah/jvmti/TestHeapDump.sh
32285 views
#!/bin/sh12#3# Copyright (c) 2017, 2018, Red Hat, Inc. All rights reserved.4#5# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.6#7# This code is free software; you can redistribute it and/or modify it8# under the terms of the GNU General Public License version 2 only, as9# published by the Free Software Foundation.10#11# This code is distributed in the hope that it will be useful, but WITHOUT12# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or13# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License14# version 2 for more details (a copy is included in the LICENSE file that15# accompanied this code).16#17# You should have received a copy of the GNU General Public License version18# 2 along with this work; if not, write to the Free Software Foundation,19# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.20#21# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA22# or visit www.oracle.com if you need additional information or have any23# questions.24#2526##27## @test28## @summary test JNI critical arrays support in Shenandoah29## @run shell/timeout=480 TestHeapDump.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;52fi5354# Unfortunately, configurations cross-compiled to 32 bits would55# fail with bitness mismatch, when compiled with platform gcc.56# This would be fixed with /native support in JDK-8072842.57if [ "$VM_BITS" = "32" ]; then58echo "Test passed; only reliable on 64-bit"59exit 0;60fi6162THIS_DIR=.6364cp ${TESTSRC}${FS}*.java ${THIS_DIR}65${TESTJAVA}${FS}bin${FS}javac TestHeapDump.java6667$gcc_cmd -O1 -DLINUX -fPIC -shared \68-o ${THIS_DIR}${FS}libTestHeapDump.so \69-I${TESTJAVA}${FS}include \70-I${TESTJAVA}${FS}include${FS}linux \71${TESTSRC}${FS}libTestHeapDump.c7273# run the java test in the background74cmd="${TESTJAVA}${FS}bin${FS}java -agentpath:./libTestHeapDump.so -Xmx128m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive \75-Djava.library.path=${THIS_DIR}${FS} TestHeapDump"7677echo "$cmd"78eval $cmd7980if [ $? -ne 0 ]81then82echo "Test Failed"83exit 184fi8586if [ "$VM_BITS" = "64" ]; then87cmd="${TESTJAVA}${FS}bin${FS}java -agentpath:./libTestHeapDump.so -Xmx128m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive \88-XX:-UseCompressedOops -Djava.library.path=${THIS_DIR}${FS} TestHeapDump"8990echo "$cmd"91eval $cmd9293if [ $? -ne 0 ]94then95echo "Test Failed"96exit 197fi98else99echo "Test passed; only valid for 64 bits"100exit 0;101fi102103104