Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/test/runtime/6929067/Test6929067.sh
32284 views
#!/bin/sh12##3## @test Test6929067.sh4## @bug 69290675## @bug 80212966## @summary Stack guard pages should be removed when thread is detached7## @compile T.java8## @run shell Test6929067.sh9##10set -x11if [ "${TESTSRC}" = "" ]12then13TESTSRC=${PWD}14echo "TESTSRC not set. Using "${TESTSRC}" as default"15fi16echo "TESTSRC=${TESTSRC}"17## Adding common setup Variables for running shell tests.18. ${TESTSRC}/../../test_env.sh1920# set platform-dependent variables21OS=`uname -s`22case "$OS" in23Linux)24gcc_cmd=`which gcc`25if [ "x$gcc_cmd" == "x" ]; then26echo "WARNING: gcc not found. Cannot execute test." 2>&127exit 0;28fi29NULL=/dev/null30PS=":"31FS="/"32;;33* )34echo "Test passed; only valid for Linux"35exit 0;36;;37esac3839${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -Xinternalversion > vm_version.out 2>&14041# Bitness:42# Cannot simply look at TESTVMOPTS as -d64 is not43# passed if there is only a 64-bit JVM available.4445grep "64-Bit" vm_version.out > ${NULL}46if [ "$?" = "0" ]47then48COMP_FLAG="-m64"49else50COMP_FLAG="-m32"51fi525354# Architecture:55# Translate uname output to JVM directory name, but permit testing56# 32-bit x86 on an x64 platform.57ARCH=`uname -m`58case "$ARCH" in59x86_64)60if [ "$COMP_FLAG" = "-m32" ]; then61ARCH=i38662else63ARCH=amd6464fi65;;66ppc64)67if [ "$COMP_FLAG" = "-m32" ]; then68ARCH=ppc69else70ARCH=ppc6471fi72;;73sparc64)74if [ "$COMP_FLAG" = "-m32" ]; then75ARCH=sparc76else77ARCH=sparc6478fi79;;80arm*)81# 32-bit ARM machine: compiler may not recognise -m3282COMP_FLAG=""83ARCH=arm84;;85aarch64)86# 64-bit arm machine, could be testing 32 or 64-bit:87if [ "$COMP_FLAG" = "-m32" ]; then88ARCH=arm89else90ARCH=aarch6491fi92;;93i586)94ARCH=i38695;;96i686)97ARCH=i38698;;99# Assuming other ARCH values need no translation100esac101102103# VM type: need to know server or client104VMTYPE=client105grep Server vm_version.out > ${NULL}106if [ "$?" = "0" ]107then108VMTYPE=server109fi110111112LD_LIBRARY_PATH=.:${COMPILEJAVA}/jre/lib/${ARCH}/${VMTYPE}:/usr/lib:$LD_LIBRARY_PATH113export LD_LIBRARY_PATH114115cp ${TESTSRC}${FS}invoke.c .116117# Copy the result of our @compile action:118cp ${TESTCLASSES}${FS}T.class .119120echo "Architecture: ${ARCH}"121echo "Compilation flag: ${COMP_FLAG}"122echo "VM type: ${VMTYPE}"123# Note pthread may not be found thus invoke creation will fail to be created.124# Check to ensure you have a /usr/lib/libpthread.so if you don't please look125# for /usr/lib/`uname -m`-linux-gnu version ensure to add that path to below compilation.126127$gcc_cmd -DLINUX ${COMP_FLAG} -o invoke \128-I${COMPILEJAVA}/include -I${COMPILEJAVA}/include/linux \129-L${COMPILEJAVA}/jre/lib/${ARCH}/${VMTYPE} \130-ljvm -lpthread invoke.c131132./invoke133exit $?134135136