test/runtime/6929067/Test6929067.sh

changeset 0
f90c822e73f8
child 6876
710a3c8b516e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/test/runtime/6929067/Test6929067.sh	Wed Apr 27 01:25:04 2016 +0800
     1.3 @@ -0,0 +1,135 @@
     1.4 +#!/bin/sh
     1.5 +
     1.6 +##
     1.7 +## @ignore 8028740
     1.8 +## @test Test6929067.sh
     1.9 +## @bug 6929067
    1.10 +## @bug 8021296
    1.11 +## @summary Stack guard pages should be removed when thread is detached
    1.12 +## @compile T.java
    1.13 +## @run shell Test6929067.sh
    1.14 +##
    1.15 +set -x
    1.16 +if [ "${TESTSRC}" = "" ]
    1.17 +then
    1.18 +  TESTSRC=${PWD}
    1.19 +  echo "TESTSRC not set.  Using "${TESTSRC}" as default"
    1.20 +fi
    1.21 +echo "TESTSRC=${TESTSRC}"
    1.22 +## Adding common setup Variables for running shell tests.
    1.23 +. ${TESTSRC}/../../test_env.sh
    1.24 +
    1.25 +# set platform-dependent variables
    1.26 +OS=`uname -s`
    1.27 +case "$OS" in
    1.28 +  Linux)
    1.29 +    gcc_cmd=`which gcc`
    1.30 +    if [ "x$gcc_cmd" == "x" ]; then
    1.31 +        echo "WARNING: gcc not found. Cannot execute test." 2>&1
    1.32 +        exit 0;
    1.33 +    fi
    1.34 +    NULL=/dev/null
    1.35 +    PS=":"
    1.36 +    FS="/"
    1.37 +    ;;
    1.38 +  * )
    1.39 +    echo "Test passed; only valid for Linux"
    1.40 +    exit 0;
    1.41 +    ;;
    1.42 +esac
    1.43 +
    1.44 +${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -Xinternalversion > vm_version.out 2>&1 
    1.45 +
    1.46 +# Bitness:
    1.47 +# Cannot simply look at TESTVMOPTS as -d64 is not
    1.48 +# passed if there is only a 64-bit JVM available.
    1.49 +
    1.50 +grep "64-Bit" vm_version.out > ${NULL}
    1.51 +if [ "$?" = "0" ]
    1.52 +then
    1.53 +  COMP_FLAG="-m64"
    1.54 +else
    1.55 +  COMP_FLAG="-m32"
    1.56 +fi
    1.57 +
    1.58 +
    1.59 +# Architecture:
    1.60 +# Translate uname output to JVM directory name, but permit testing
    1.61 +# 32-bit x86 on an x64 platform.
    1.62 +ARCH=`uname -m`
    1.63 +case "$ARCH" in
    1.64 +  x86_64)
    1.65 +    if [ "$COMP_FLAG" = "-m32" ]; then
    1.66 +      ARCH=i386
    1.67 +    else 
    1.68 +      ARCH=amd64
    1.69 +    fi
    1.70 +    ;;
    1.71 +  ppc64)
    1.72 +    if [ "$COMP_FLAG" = "-m32" ]; then
    1.73 +      ARCH=ppc
    1.74 +    else 
    1.75 +      ARCH=ppc64
    1.76 +    fi
    1.77 +    ;;
    1.78 +  sparc64)
    1.79 +    if [ "$COMP_FLAG" = "-m32" ]; then
    1.80 +      ARCH=sparc
    1.81 +    else 
    1.82 +      ARCH=sparc64
    1.83 +    fi
    1.84 +    ;;
    1.85 +  arm*)
    1.86 +    # 32-bit ARM machine: compiler may not recognise -m32
    1.87 +    COMP_FLAG=""
    1.88 +    ARCH=arm
    1.89 +    ;;
    1.90 +  aarch64)
    1.91 +    # 64-bit arm machine, could be testing 32 or 64-bit:
    1.92 +    if [ "$COMP_FLAG" = "-m32" ]; then
    1.93 +      ARCH=arm
    1.94 +    else 
    1.95 +      ARCH=aarch64
    1.96 +    fi
    1.97 +    ;;
    1.98 +  i586)
    1.99 +    ARCH=i386
   1.100 +    ;;
   1.101 +  i686)
   1.102 +    ARCH=i386
   1.103 +    ;;
   1.104 +  # Assuming other ARCH values need no translation
   1.105 +esac
   1.106 +
   1.107 +
   1.108 +# VM type: need to know server or client
   1.109 +VMTYPE=client
   1.110 +grep Server vm_version.out > ${NULL}
   1.111 +if [ "$?" = "0" ]
   1.112 +then
   1.113 +  VMTYPE=server
   1.114 +fi
   1.115 +
   1.116 +
   1.117 +LD_LIBRARY_PATH=.:${COMPILEJAVA}/jre/lib/${ARCH}/${VMTYPE}:/usr/lib:$LD_LIBRARY_PATH
   1.118 +export LD_LIBRARY_PATH
   1.119 +
   1.120 +cp ${TESTSRC}${FS}invoke.c .
   1.121 +
   1.122 +# Copy the result of our @compile action:
   1.123 +cp ${TESTCLASSES}${FS}T.class .
   1.124 +
   1.125 +echo "Architecture: ${ARCH}"
   1.126 +echo "Compilation flag: ${COMP_FLAG}"
   1.127 +echo "VM type: ${VMTYPE}"
   1.128 +# Note pthread may not be found thus invoke creation will fail to be created.
   1.129 +# Check to ensure you have a /usr/lib/libpthread.so if you don't please look
   1.130 +# for /usr/lib/`uname -m`-linux-gnu version ensure to add that path to below compilation.
   1.131 +
   1.132 +$gcc_cmd -DLINUX ${COMP_FLAG} -o invoke \
   1.133 +    -I${COMPILEJAVA}/include -I${COMPILEJAVA}/include/linux \
   1.134 +    -L${COMPILEJAVA}/jre/lib/${ARCH}/${VMTYPE} \
   1.135 +    -ljvm -lpthread invoke.c
   1.136 +
   1.137 +./invoke
   1.138 +exit $?

mercurial