test/runtime/6929067/Test6929067.sh

Thu, 04 Jul 2013 01:00:19 -0700

author
cl
date
Thu, 04 Jul 2013 01:00:19 -0700
changeset 5323
2bfa00fac03f
parent 4831
04d6d4322c6a
child 5453
f9ee986a9fea
permissions
-rw-r--r--

Added tag jdk8-b97 for changeset d197d377ab2e

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

mercurial