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