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