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