hotspot/test/runtime/6929067/Test6929067.sh
author duke
Wed, 05 Jul 2017 18:19:25 +0200
changeset 13436 daa93504bd70
parent 12729 684b5857e506
child 13469 9a2973794d8c
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5085
4f0c435f8c3c 6929067: Stack guard pages should be removed when thread is detached
coleenp
parents:
diff changeset
     1
#!/bin/sh
4f0c435f8c3c 6929067: Stack guard pages should be removed when thread is detached
coleenp
parents:
diff changeset
     2
4f0c435f8c3c 6929067: Stack guard pages should be removed when thread is detached
coleenp
parents:
diff changeset
     3
##
4f0c435f8c3c 6929067: Stack guard pages should be removed when thread is detached
coleenp
parents:
diff changeset
     4
## @test Test6929067.sh
4f0c435f8c3c 6929067: Stack guard pages should be removed when thread is detached
coleenp
parents:
diff changeset
     5
## @bug 6929067
4f0c435f8c3c 6929067: Stack guard pages should be removed when thread is detached
coleenp
parents:
diff changeset
     6
## @summary Stack guard pages should be removed when thread is detached
4f0c435f8c3c 6929067: Stack guard pages should be removed when thread is detached
coleenp
parents:
diff changeset
     7
## @run shell Test6929067.sh
4f0c435f8c3c 6929067: Stack guard pages should be removed when thread is detached
coleenp
parents:
diff changeset
     8
##
4f0c435f8c3c 6929067: Stack guard pages should be removed when thread is detached
coleenp
parents:
diff changeset
     9
4f0c435f8c3c 6929067: Stack guard pages should be removed when thread is detached
coleenp
parents:
diff changeset
    10
if [ "${TESTSRC}" = "" ]
4f0c435f8c3c 6929067: Stack guard pages should be removed when thread is detached
coleenp
parents:
diff changeset
    11
then TESTSRC=.
4f0c435f8c3c 6929067: Stack guard pages should be removed when thread is detached
coleenp
parents:
diff changeset
    12
fi
4f0c435f8c3c 6929067: Stack guard pages should be removed when thread is detached
coleenp
parents:
diff changeset
    13
4f0c435f8c3c 6929067: Stack guard pages should be removed when thread is detached
coleenp
parents:
diff changeset
    14
if [ "${TESTJAVA}" = "" ]
4f0c435f8c3c 6929067: Stack guard pages should be removed when thread is detached
coleenp
parents:
diff changeset
    15
then
4f0c435f8c3c 6929067: Stack guard pages should be removed when thread is detached
coleenp
parents:
diff changeset
    16
  PARENT=`dirname \`which java\``
4f0c435f8c3c 6929067: Stack guard pages should be removed when thread is detached
coleenp
parents:
diff changeset
    17
  TESTJAVA=`dirname ${PARENT}`
4f0c435f8c3c 6929067: Stack guard pages should be removed when thread is detached
coleenp
parents:
diff changeset
    18
  echo "TESTJAVA not set, selecting " ${TESTJAVA}
4f0c435f8c3c 6929067: Stack guard pages should be removed when thread is detached
coleenp
parents:
diff changeset
    19
  echo "If this is incorrect, try setting the variable manually."
4f0c435f8c3c 6929067: Stack guard pages should be removed when thread is detached
coleenp
parents:
diff changeset
    20
fi
4f0c435f8c3c 6929067: Stack guard pages should be removed when thread is detached
coleenp
parents:
diff changeset
    21
4f0c435f8c3c 6929067: Stack guard pages should be removed when thread is detached
coleenp
parents:
diff changeset
    22
# set platform-dependent variables
4f0c435f8c3c 6929067: Stack guard pages should be removed when thread is detached
coleenp
parents:
diff changeset
    23
OS=`uname -s`
4f0c435f8c3c 6929067: Stack guard pages should be removed when thread is detached
coleenp
parents:
diff changeset
    24
case "$OS" in
4f0c435f8c3c 6929067: Stack guard pages should be removed when thread is detached
coleenp
parents:
diff changeset
    25
  Linux)
4f0c435f8c3c 6929067: Stack guard pages should be removed when thread is detached
coleenp
parents:
diff changeset
    26
    NULL=/dev/null
4f0c435f8c3c 6929067: Stack guard pages should be removed when thread is detached
coleenp
parents:
diff changeset
    27
    PS=":"
4f0c435f8c3c 6929067: Stack guard pages should be removed when thread is detached
coleenp
parents:
diff changeset
    28
    FS="/"
4f0c435f8c3c 6929067: Stack guard pages should be removed when thread is detached
coleenp
parents:
diff changeset
    29
    ;;
10565
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents: 5085
diff changeset
    30
  SunOS | Windows_* | *BSD)
5085
4f0c435f8c3c 6929067: Stack guard pages should be removed when thread is detached
coleenp
parents:
diff changeset
    31
    NULL=NUL
4f0c435f8c3c 6929067: Stack guard pages should be removed when thread is detached
coleenp
parents:
diff changeset
    32
    PS=";"
4f0c435f8c3c 6929067: Stack guard pages should be removed when thread is detached
coleenp
parents:
diff changeset
    33
    FS="\\"
4f0c435f8c3c 6929067: Stack guard pages should be removed when thread is detached
coleenp
parents:
diff changeset
    34
    echo "Test passed; only valid for Linux"
4f0c435f8c3c 6929067: Stack guard pages should be removed when thread is detached
coleenp
parents:
diff changeset
    35
    exit 0;
4f0c435f8c3c 6929067: Stack guard pages should be removed when thread is detached
coleenp
parents:
diff changeset
    36
    ;;
4f0c435f8c3c 6929067: Stack guard pages should be removed when thread is detached
coleenp
parents:
diff changeset
    37
  * )
4f0c435f8c3c 6929067: Stack guard pages should be removed when thread is detached
coleenp
parents:
diff changeset
    38
    echo "Unrecognized system!"
4f0c435f8c3c 6929067: Stack guard pages should be removed when thread is detached
coleenp
parents:
diff changeset
    39
    exit 1;
4f0c435f8c3c 6929067: Stack guard pages should be removed when thread is detached
coleenp
parents:
diff changeset
    40
    ;;
4f0c435f8c3c 6929067: Stack guard pages should be removed when thread is detached
coleenp
parents:
diff changeset
    41
esac
4f0c435f8c3c 6929067: Stack guard pages should be removed when thread is detached
coleenp
parents:
diff changeset
    42
12729
684b5857e506 7157734: hotspot test scripts not testing 64-bit JVM under JPRT/JTREG.
kevinw
parents: 10565
diff changeset
    43
# Choose arch: i386 or amd64 (test is Linux-specific)
684b5857e506 7157734: hotspot test scripts not testing 64-bit JVM under JPRT/JTREG.
kevinw
parents: 10565
diff changeset
    44
# Cannot simply look at TESTVMOPTS as -d64 is not
684b5857e506 7157734: hotspot test scripts not testing 64-bit JVM under JPRT/JTREG.
kevinw
parents: 10565
diff changeset
    45
# passed if there is only a 64-bit JVM available.
684b5857e506 7157734: hotspot test scripts not testing 64-bit JVM under JPRT/JTREG.
kevinw
parents: 10565
diff changeset
    46
684b5857e506 7157734: hotspot test scripts not testing 64-bit JVM under JPRT/JTREG.
kevinw
parents: 10565
diff changeset
    47
${TESTJAVA}/bin/java ${TESTVMOPTS} -version 2>1 | grep "64-Bit" >/dev/null
684b5857e506 7157734: hotspot test scripts not testing 64-bit JVM under JPRT/JTREG.
kevinw
parents: 10565
diff changeset
    48
if [ "$?" = "0" ]
684b5857e506 7157734: hotspot test scripts not testing 64-bit JVM under JPRT/JTREG.
kevinw
parents: 10565
diff changeset
    49
then
684b5857e506 7157734: hotspot test scripts not testing 64-bit JVM under JPRT/JTREG.
kevinw
parents: 10565
diff changeset
    50
  ARCH=amd64
684b5857e506 7157734: hotspot test scripts not testing 64-bit JVM under JPRT/JTREG.
kevinw
parents: 10565
diff changeset
    51
else
684b5857e506 7157734: hotspot test scripts not testing 64-bit JVM under JPRT/JTREG.
kevinw
parents: 10565
diff changeset
    52
  ARCH=i386
684b5857e506 7157734: hotspot test scripts not testing 64-bit JVM under JPRT/JTREG.
kevinw
parents: 10565
diff changeset
    53
fi
684b5857e506 7157734: hotspot test scripts not testing 64-bit JVM under JPRT/JTREG.
kevinw
parents: 10565
diff changeset
    54
684b5857e506 7157734: hotspot test scripts not testing 64-bit JVM under JPRT/JTREG.
kevinw
parents: 10565
diff changeset
    55
LD_LIBRARY_PATH=.:${TESTJAVA}/jre/lib/${ARCH}/client:/usr/openwin/lib:/usr/dt/lib:/usr/lib:$LD_LIBRARY_PATH
5085
4f0c435f8c3c 6929067: Stack guard pages should be removed when thread is detached
coleenp
parents:
diff changeset
    56
export LD_LIBRARY_PATH
4f0c435f8c3c 6929067: Stack guard pages should be removed when thread is detached
coleenp
parents:
diff changeset
    57
4f0c435f8c3c 6929067: Stack guard pages should be removed when thread is detached
coleenp
parents:
diff changeset
    58
THIS_DIR=`pwd`
4f0c435f8c3c 6929067: Stack guard pages should be removed when thread is detached
coleenp
parents:
diff changeset
    59
4f0c435f8c3c 6929067: Stack guard pages should be removed when thread is detached
coleenp
parents:
diff changeset
    60
cp ${TESTSRC}${FS}invoke.c ${THIS_DIR}
4f0c435f8c3c 6929067: Stack guard pages should be removed when thread is detached
coleenp
parents:
diff changeset
    61
cp ${TESTSRC}${FS}T.java ${THIS_DIR}
4f0c435f8c3c 6929067: Stack guard pages should be removed when thread is detached
coleenp
parents:
diff changeset
    62
4f0c435f8c3c 6929067: Stack guard pages should be removed when thread is detached
coleenp
parents:
diff changeset
    63
12729
684b5857e506 7157734: hotspot test scripts not testing 64-bit JVM under JPRT/JTREG.
kevinw
parents: 10565
diff changeset
    64
${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -fullversion
5085
4f0c435f8c3c 6929067: Stack guard pages should be removed when thread is detached
coleenp
parents:
diff changeset
    65
4f0c435f8c3c 6929067: Stack guard pages should be removed when thread is detached
coleenp
parents:
diff changeset
    66
${TESTJAVA}${FS}bin${FS}javac T.java
4f0c435f8c3c 6929067: Stack guard pages should be removed when thread is detached
coleenp
parents:
diff changeset
    67
12729
684b5857e506 7157734: hotspot test scripts not testing 64-bit JVM under JPRT/JTREG.
kevinw
parents: 10565
diff changeset
    68
gcc -o invoke -I${TESTJAVA}/include -I${TESTJAVA}/include/linux invoke.c ${TESTJAVA}/jre/lib/${ARCH}/client/libjvm.so
5085
4f0c435f8c3c 6929067: Stack guard pages should be removed when thread is detached
coleenp
parents:
diff changeset
    69
./invoke
4f0c435f8c3c 6929067: Stack guard pages should be removed when thread is detached
coleenp
parents:
diff changeset
    70
exit $?