Thu, 13 Dec 2012 09:05:20 -0800
Added tag jdk8-b68 for changeset 121aa71316af
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 | ## |
coleenp@1755 | 10 | |
coleenp@1755 | 11 | if [ "${TESTSRC}" = "" ] |
coleenp@1755 | 12 | then TESTSRC=. |
coleenp@1755 | 13 | fi |
coleenp@1755 | 14 | |
coleenp@1755 | 15 | if [ "${TESTJAVA}" = "" ] |
coleenp@1755 | 16 | then |
coleenp@1755 | 17 | PARENT=`dirname \`which java\`` |
coleenp@1755 | 18 | TESTJAVA=`dirname ${PARENT}` |
coleenp@1755 | 19 | echo "TESTJAVA not set, selecting " ${TESTJAVA} |
coleenp@1755 | 20 | echo "If this is incorrect, try setting the variable manually." |
coleenp@1755 | 21 | fi |
coleenp@1755 | 22 | |
coleenp@1755 | 23 | # set platform-dependent variables |
coleenp@1755 | 24 | OS=`uname -s` |
coleenp@1755 | 25 | case "$OS" in |
coleenp@1755 | 26 | Linux) |
coleenp@1755 | 27 | NULL=/dev/null |
coleenp@1755 | 28 | PS=":" |
coleenp@1755 | 29 | FS="/" |
coleenp@1755 | 30 | ;; |
coleenp@3985 | 31 | * ) |
coleenp@1755 | 32 | echo "Test passed; only valid for Linux" |
coleenp@1755 | 33 | exit 0; |
coleenp@1755 | 34 | ;; |
coleenp@1755 | 35 | esac |
coleenp@1755 | 36 | |
kevinw@4180 | 37 | ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -Xinternalversion > vm_version.out 2>&1 |
kevinw@4180 | 38 | |
kevinw@4180 | 39 | # Bitness: |
kevinw@3777 | 40 | # Cannot simply look at TESTVMOPTS as -d64 is not |
kevinw@3777 | 41 | # passed if there is only a 64-bit JVM available. |
kevinw@3777 | 42 | |
kevinw@4180 | 43 | grep "64-Bit" vm_version.out > ${NULL} |
kevinw@3777 | 44 | if [ "$?" = "0" ] |
kevinw@3777 | 45 | then |
kevinw@4180 | 46 | COMP_FLAG="-m64" |
kevinw@3777 | 47 | else |
kevinw@4180 | 48 | COMP_FLAG="-m32" |
kevinw@3777 | 49 | fi |
kevinw@3777 | 50 | |
kevinw@4180 | 51 | |
kevinw@4180 | 52 | # Architecture: |
kevinw@4180 | 53 | # Translate uname output to JVM directory name, but permit testing |
kevinw@4180 | 54 | # 32-bit x86 on an x64 platform. |
kevinw@4180 | 55 | ARCH=`uname -m` |
kevinw@4180 | 56 | case "$ARCH" in |
kevinw@4180 | 57 | x86_64) |
kevinw@4180 | 58 | if [ "$COMP_FLAG" = "-m32" ]; then |
kevinw@4180 | 59 | ARCH=i386 |
kevinw@4180 | 60 | else |
kevinw@4180 | 61 | ARCH=amd64 |
kevinw@4180 | 62 | fi |
kevinw@4180 | 63 | ;; |
kevinw@4180 | 64 | ppc64) |
kevinw@4180 | 65 | if [ "$COMP_FLAG" = "-m32" ]; then |
kevinw@4180 | 66 | ARCH=ppc |
kevinw@4180 | 67 | else |
kevinw@4180 | 68 | ARCH=ppc64 |
kevinw@4180 | 69 | fi |
kevinw@4180 | 70 | ;; |
kevinw@4180 | 71 | sparc64) |
kevinw@4180 | 72 | if [ "$COMP_FLAG" = "-m32" ]; then |
kevinw@4180 | 73 | ARCH=sparc |
kevinw@4180 | 74 | else |
kevinw@4180 | 75 | ARCH=sparc64 |
kevinw@4180 | 76 | fi |
kevinw@4180 | 77 | ;; |
kevinw@4180 | 78 | arm*) |
kevinw@4180 | 79 | # 32-bit ARM machine: compiler may not recognise -m32 |
kevinw@4180 | 80 | COMP_FLAG="" |
kevinw@4180 | 81 | ARCH=arm |
kevinw@4180 | 82 | ;; |
kevinw@4180 | 83 | aarch64) |
kevinw@4180 | 84 | # 64-bit arm machine, could be testing 32 or 64-bit: |
kevinw@4180 | 85 | if [ "$COMP_FLAG" = "-m32" ]; then |
kevinw@4180 | 86 | ARCH=arm |
kevinw@4180 | 87 | else |
kevinw@4180 | 88 | ARCH=aarch64 |
kevinw@4180 | 89 | fi |
kevinw@4180 | 90 | ;; |
kevinw@4180 | 91 | i586) |
kevinw@4180 | 92 | ARCH=i386 |
kevinw@4180 | 93 | ;; |
kevinw@4180 | 94 | i686) |
kevinw@4180 | 95 | ARCH=i386 |
kevinw@4180 | 96 | ;; |
kevinw@4180 | 97 | # Assuming other ARCH values need no translation |
kevinw@4180 | 98 | esac |
kevinw@4180 | 99 | |
kevinw@4180 | 100 | |
kevinw@4180 | 101 | # VM type: need to know server or client |
kevinw@4180 | 102 | VMTYPE=client |
kevinw@4180 | 103 | grep Server vm_version.out > ${NULL} |
kevinw@4180 | 104 | if [ "$?" = "0" ] |
kevinw@4180 | 105 | then |
kevinw@4180 | 106 | VMTYPE=server |
kevinw@4180 | 107 | fi |
kevinw@4180 | 108 | |
kevinw@4180 | 109 | |
kevinw@4180 | 110 | LD_LIBRARY_PATH=.:${TESTJAVA}/jre/lib/${ARCH}/${VMTYPE}:/usr/lib:$LD_LIBRARY_PATH |
coleenp@1755 | 111 | export LD_LIBRARY_PATH |
coleenp@1755 | 112 | |
kevinw@4180 | 113 | cp ${TESTSRC}${FS}invoke.c . |
coleenp@1755 | 114 | |
kevinw@4180 | 115 | # Copy the result of our @compile action: |
kevinw@4180 | 116 | cp ${TESTCLASSES}${FS}T.class . |
coleenp@1755 | 117 | |
kevinw@3777 | 118 | ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -fullversion |
coleenp@1755 | 119 | |
kevinw@4180 | 120 | echo "Architecture: ${ARCH}" |
kevinw@4180 | 121 | echo "Compilation flag: ${COMP_FLAG}" |
kevinw@4180 | 122 | echo "VM type: ${VMTYPE}" |
coleenp@1755 | 123 | |
kevinw@4180 | 124 | gcc -DLINUX ${COMP_FLAG} -o invoke \ |
kevinw@4180 | 125 | -I${TESTJAVA}/include -I${TESTJAVA}/include/linux \ |
kevinw@4180 | 126 | -L${TESTJAVA}/jre/lib/${ARCH}/${VMTYPE} \ |
kevinw@4180 | 127 | -ljvm -lpthread invoke.c |
kevinw@4180 | 128 | |
coleenp@1755 | 129 | ./invoke |
coleenp@1755 | 130 | exit $? |