2010-03-12 10:42:16 -05:00
|
|
|
#!/bin/sh
|
|
|
|
|
2014-05-22 13:22:09 -07:00
|
|
|
#
|
|
|
|
# @test testme.sh
|
|
|
|
# @summary Stack guard pages should be installed correctly and removed when thread is detached
|
|
|
|
# @run shell testme.sh
|
|
|
|
#
|
2014-01-15 11:46:19 +01:00
|
|
|
|
2010-03-12 10:42:16 -05:00
|
|
|
if [ "${TESTSRC}" = "" ]
|
|
|
|
then
|
2013-03-27 09:49:51 -07:00
|
|
|
TESTSRC=${PWD}
|
|
|
|
echo "TESTSRC not set. Using "${TESTSRC}" as default"
|
2010-03-12 10:42:16 -05:00
|
|
|
fi
|
2013-03-27 09:49:51 -07:00
|
|
|
echo "TESTSRC=${TESTSRC}"
|
|
|
|
## Adding common setup Variables for running shell tests.
|
|
|
|
. ${TESTSRC}/../../test_env.sh
|
2010-03-12 10:42:16 -05:00
|
|
|
|
2014-04-09 06:09:43 -07:00
|
|
|
if [ "${VM_OS}" != "linux" ]
|
2012-05-11 17:24:32 +01:00
|
|
|
then
|
2014-04-09 06:09:43 -07:00
|
|
|
echo "Test only valid for Linux"
|
|
|
|
exit 0
|
2012-05-11 17:24:32 +01:00
|
|
|
fi
|
|
|
|
|
2014-04-09 06:09:43 -07:00
|
|
|
gcc_cmd=`which gcc`
|
|
|
|
if [ "x$gcc_cmd" = "x" ]; then
|
|
|
|
echo "WARNING: gcc not found. Cannot execute test." 2>&1
|
|
|
|
exit 0;
|
2012-10-15 16:48:48 +01:00
|
|
|
fi
|
|
|
|
|
2014-04-09 06:09:43 -07:00
|
|
|
CFLAGS=-m${VM_BITS}
|
2012-10-15 16:48:48 +01:00
|
|
|
|
2014-05-22 13:22:09 -07:00
|
|
|
LD_LIBRARY_PATH=.:${TESTJAVA}/jre/lib/${VM_CPU}/${VM_TYPE}:${TESTJAVA}/lib/${VM_CPU}/${VM_TYPE}:/usr/lib:$LD_LIBRARY_PATH
|
2012-10-15 16:48:48 +01:00
|
|
|
export LD_LIBRARY_PATH
|
|
|
|
|
2014-04-09 06:09:43 -07:00
|
|
|
echo "Architecture: ${VM_CPU}"
|
|
|
|
echo "Compilation flag: ${CFLAGS}"
|
|
|
|
echo "VM type: ${VM_TYPE}"
|
|
|
|
echo "LD_LIBRARY_PATH: ${LD_LIBRARY_PATH}"
|
2010-03-12 10:42:16 -05:00
|
|
|
|
2013-03-27 09:49:51 -07:00
|
|
|
# Note pthread may not be found thus invoke creation will fail to be created.
|
|
|
|
# Check to ensure you have a /usr/lib/libpthread.so if you don't please look
|
|
|
|
# for /usr/lib/`uname -m`-linux-gnu version ensure to add that path to below compilation.
|
2012-10-15 16:48:48 +01:00
|
|
|
|
2014-05-22 13:22:09 -07:00
|
|
|
cp ${TESTSRC}/DoOverflow.java .
|
|
|
|
${COMPILEJAVA}/bin/javac DoOverflow.java
|
|
|
|
|
|
|
|
$gcc_cmd -DLINUX -g3 ${CFLAGS} -o invoke \
|
2014-04-09 06:09:43 -07:00
|
|
|
-I${TESTJAVA}/include -I${TESTJAVA}/include/linux \
|
|
|
|
-L${TESTJAVA}/jre/lib/${VM_CPU}/${VM_TYPE} \
|
2014-05-22 13:22:09 -07:00
|
|
|
-L${TESTJAVA}/lib/${VM_CPU}/${VM_TYPE} \
|
2014-04-09 06:09:43 -07:00
|
|
|
${TESTSRC}/invoke.c -ljvm -lpthread
|
2010-03-12 10:42:16 -05:00
|
|
|
|
2014-05-22 13:22:09 -07:00
|
|
|
if [ $? -ne 0 ] ; then
|
|
|
|
echo "Compile failed, Ignoring failed compilation and forcing the test to pass"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
./invoke test_java_overflow
|
|
|
|
./invoke test_native_overflow
|
2010-03-12 10:42:16 -05:00
|
|
|
exit $?
|