test/runtime/6929067/Test6929067.sh

Thu, 19 Sep 2013 09:36:51 -0700

author
cl
date
Thu, 19 Sep 2013 09:36:51 -0700
changeset 5664
34aa07e92d22
parent 5453
f9ee986a9fea
child 6133
e567d5afd4dd
permissions
-rw-r--r--

Added tag jdk8-b108 for changeset 85072013aad4

coleenp@1755 1 #!/bin/sh
coleenp@1755 2
coleenp@1755 3 ##
coleenp@1755 4 ## @test Test6929067.sh
coleenp@1755 5 ## @bug 6929067
ccheung@5453 6 ## @bug 8021296
coleenp@1755 7 ## @summary Stack guard pages should be removed when thread is detached
kevinw@4180 8 ## @compile T.java
coleenp@1755 9 ## @run shell Test6929067.sh
coleenp@1755 10 ##
collins@4831 11 set -x
coleenp@1755 12 if [ "${TESTSRC}" = "" ]
collins@4831 13 then
collins@4831 14 TESTSRC=${PWD}
collins@4831 15 echo "TESTSRC not set. Using "${TESTSRC}" as default"
coleenp@1755 16 fi
collins@4831 17 echo "TESTSRC=${TESTSRC}"
collins@4831 18 ## Adding common setup Variables for running shell tests.
collins@4831 19 . ${TESTSRC}/../../test_env.sh
coleenp@1755 20
coleenp@1755 21 # set platform-dependent variables
coleenp@1755 22 OS=`uname -s`
coleenp@1755 23 case "$OS" in
coleenp@1755 24 Linux)
ccheung@5453 25 gcc_cmd=`which gcc`
ccheung@5453 26 if [ "x$gcc_cmd" == "x" ]; then
ccheung@5453 27 echo "WARNING: gcc not found. Cannot execute test." 2>&1
ccheung@5453 28 exit 0;
ccheung@5453 29 fi
coleenp@1755 30 NULL=/dev/null
coleenp@1755 31 PS=":"
coleenp@1755 32 FS="/"
coleenp@1755 33 ;;
coleenp@3985 34 * )
coleenp@1755 35 echo "Test passed; only valid for Linux"
coleenp@1755 36 exit 0;
coleenp@1755 37 ;;
coleenp@1755 38 esac
coleenp@1755 39
kevinw@4180 40 ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -Xinternalversion > vm_version.out 2>&1
kevinw@4180 41
kevinw@4180 42 # Bitness:
kevinw@3777 43 # Cannot simply look at TESTVMOPTS as -d64 is not
kevinw@3777 44 # passed if there is only a 64-bit JVM available.
kevinw@3777 45
kevinw@4180 46 grep "64-Bit" vm_version.out > ${NULL}
kevinw@3777 47 if [ "$?" = "0" ]
kevinw@3777 48 then
kevinw@4180 49 COMP_FLAG="-m64"
kevinw@3777 50 else
kevinw@4180 51 COMP_FLAG="-m32"
kevinw@3777 52 fi
kevinw@3777 53
kevinw@4180 54
kevinw@4180 55 # Architecture:
kevinw@4180 56 # Translate uname output to JVM directory name, but permit testing
kevinw@4180 57 # 32-bit x86 on an x64 platform.
kevinw@4180 58 ARCH=`uname -m`
kevinw@4180 59 case "$ARCH" in
kevinw@4180 60 x86_64)
kevinw@4180 61 if [ "$COMP_FLAG" = "-m32" ]; then
kevinw@4180 62 ARCH=i386
kevinw@4180 63 else
kevinw@4180 64 ARCH=amd64
kevinw@4180 65 fi
kevinw@4180 66 ;;
kevinw@4180 67 ppc64)
kevinw@4180 68 if [ "$COMP_FLAG" = "-m32" ]; then
kevinw@4180 69 ARCH=ppc
kevinw@4180 70 else
kevinw@4180 71 ARCH=ppc64
kevinw@4180 72 fi
kevinw@4180 73 ;;
kevinw@4180 74 sparc64)
kevinw@4180 75 if [ "$COMP_FLAG" = "-m32" ]; then
kevinw@4180 76 ARCH=sparc
kevinw@4180 77 else
kevinw@4180 78 ARCH=sparc64
kevinw@4180 79 fi
kevinw@4180 80 ;;
kevinw@4180 81 arm*)
kevinw@4180 82 # 32-bit ARM machine: compiler may not recognise -m32
kevinw@4180 83 COMP_FLAG=""
kevinw@4180 84 ARCH=arm
kevinw@4180 85 ;;
kevinw@4180 86 aarch64)
kevinw@4180 87 # 64-bit arm machine, could be testing 32 or 64-bit:
kevinw@4180 88 if [ "$COMP_FLAG" = "-m32" ]; then
kevinw@4180 89 ARCH=arm
kevinw@4180 90 else
kevinw@4180 91 ARCH=aarch64
kevinw@4180 92 fi
kevinw@4180 93 ;;
kevinw@4180 94 i586)
kevinw@4180 95 ARCH=i386
kevinw@4180 96 ;;
kevinw@4180 97 i686)
kevinw@4180 98 ARCH=i386
kevinw@4180 99 ;;
kevinw@4180 100 # Assuming other ARCH values need no translation
kevinw@4180 101 esac
kevinw@4180 102
kevinw@4180 103
kevinw@4180 104 # VM type: need to know server or client
kevinw@4180 105 VMTYPE=client
kevinw@4180 106 grep Server vm_version.out > ${NULL}
kevinw@4180 107 if [ "$?" = "0" ]
kevinw@4180 108 then
kevinw@4180 109 VMTYPE=server
kevinw@4180 110 fi
kevinw@4180 111
kevinw@4180 112
collins@4831 113 LD_LIBRARY_PATH=.:${COMPILEJAVA}/jre/lib/${ARCH}/${VMTYPE}:/usr/lib:$LD_LIBRARY_PATH
coleenp@1755 114 export LD_LIBRARY_PATH
coleenp@1755 115
kevinw@4180 116 cp ${TESTSRC}${FS}invoke.c .
coleenp@1755 117
kevinw@4180 118 # Copy the result of our @compile action:
kevinw@4180 119 cp ${TESTCLASSES}${FS}T.class .
coleenp@1755 120
kevinw@4180 121 echo "Architecture: ${ARCH}"
kevinw@4180 122 echo "Compilation flag: ${COMP_FLAG}"
kevinw@4180 123 echo "VM type: ${VMTYPE}"
collins@4831 124 # Note pthread may not be found thus invoke creation will fail to be created.
collins@4831 125 # Check to ensure you have a /usr/lib/libpthread.so if you don't please look
collins@4831 126 # for /usr/lib/`uname -m`-linux-gnu version ensure to add that path to below compilation.
coleenp@1755 127
ccheung@5453 128 $gcc_cmd -DLINUX ${COMP_FLAG} -o invoke \
ccheung@5453 129 -I${COMPILEJAVA}/include -I${COMPILEJAVA}/include/linux \
ccheung@5453 130 -L${COMPILEJAVA}/jre/lib/${ARCH}/${VMTYPE} \
ccheung@5453 131 -ljvm -lpthread invoke.c
kevinw@4180 132
coleenp@1755 133 ./invoke
coleenp@1755 134 exit $?

mercurial