test/runtime/InitialThreadOverflow/testme.sh

changeset 5612
d8e99408faad
child 5670
0f648fbe4404
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/test/runtime/InitialThreadOverflow/testme.sh	Thu Aug 29 21:48:23 2013 +0400
     1.3 @@ -0,0 +1,73 @@
     1.4 +#!/bin/sh
     1.5 +
     1.6 +# Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
     1.7 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.8 +#
     1.9 +# This code is free software; you can redistribute it and/or modify it
    1.10 +# under the terms of the GNU General Public License version 2 only, as
    1.11 +# published by the Free Software Foundation.
    1.12 +#
    1.13 +# This code is distributed in the hope that it will be useful, but WITHOUT
    1.14 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    1.15 +# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    1.16 +# version 2 for more details (a copy is included in the LICENSE file that
    1.17 +# accompanied this code).
    1.18 +#
    1.19 +# You should have received a copy of the GNU General Public License version
    1.20 +# 2 along with this work; if not, write to the Free Software Foundation,
    1.21 +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1.22 +#
    1.23 +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    1.24 +# or visit www.oracle.com if you need additional information or have any
    1.25 +# questions.
    1.26 +
    1.27 +# @test testme.sh
    1.28 +# @bug 8009062
    1.29 +# @summary Poor performance of JNI AttachCurrentThread after fix for 7017193
    1.30 +# @compile DoOverflow.java
    1.31 +# @run shell testme.sh
    1.32 +
    1.33 +set -x
    1.34 +if [ "${TESTSRC}" = "" ]
    1.35 +then
    1.36 +  TESTSRC=${PWD}
    1.37 +  echo "TESTSRC not set.  Using "${TESTSRC}" as default"
    1.38 +fi
    1.39 +echo "TESTSRC=${TESTSRC}"
    1.40 +## Adding common setup Variables for running shell tests.
    1.41 +. ${TESTSRC}/../../test_env.sh
    1.42 +
    1.43 +if [ "${VM_OS}" != "linux" ]
    1.44 +then
    1.45 +  echo "Test only valid for Linux"
    1.46 +  exit 0
    1.47 +fi
    1.48 +
    1.49 +gcc_cmd=`which gcc`
    1.50 +if [ "x$gcc_cmd" == "x" ]; then
    1.51 +    echo "WARNING: gcc not found. Cannot execute test." 2>&1
    1.52 +    exit 0;
    1.53 +fi
    1.54 +
    1.55 +CFLAGS="-m${VM_BITS}"
    1.56 +
    1.57 +LD_LIBRARY_PATH=.:${COMPILEJAVA}/jre/lib/${VM_CPU}/${VM_TYPE}:/usr/lib:$LD_LIBRARY_PATH
    1.58 +export LD_LIBRARY_PATH
    1.59 +
    1.60 +cp ${TESTSRC}${FS}invoke.cxx .
    1.61 +
    1.62 +# Copy the result of our @compile action:
    1.63 +cp ${TESTCLASSES}${FS}DoOverflow.class .
    1.64 +
    1.65 +echo "Compilation flag: ${COMP_FLAG}"
    1.66 +# Note pthread may not be found thus invoke creation will fail to be created.
    1.67 +# Check to ensure you have a /usr/lib/libpthread.so if you don't please look
    1.68 +# for /usr/lib/`uname -m`-linux-gnu version ensure to add that path to below compilation.
    1.69 +
    1.70 +$gcc_cmd -DLINUX ${CFLAGS} -o invoke \
    1.71 +    -I${COMPILEJAVA}/include -I${COMPILEJAVA}/include/linux \
    1.72 +    -L${COMPILEJAVA}/jre/lib/${VM_CPU}/${VM_TYPE} \
    1.73 +    -ljvm -lpthread invoke.cxx
    1.74 +
    1.75 +./invoke
    1.76 +exit $?

mercurial