test/runtime/6929067/Test6929067.sh

Mon, 06 Nov 2017 16:51:47 +0800

author
aoqi
date
Mon, 06 Nov 2017 16:51:47 +0800
changeset 7997
6cbff0651f1a
parent 6876
710a3c8b516e
permissions
-rw-r--r--

[Code Reorganization] remove trailing whitespace to pass jcheck test

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

mercurial