< prev index next >

hotspot/test/compiler/native/TestDirtyInt.sh

Print this page




  13 #  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14 #  version 2 for more details (a copy is included in the LICENSE file that
  15 #  accompanied this code).
  16 #
  17 #  You should have received a copy of the GNU General Public License version
  18 #  2 along with this work; if not, write to the Free Software Foundation,
  19 #  Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 #
  21 #  Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 #  or visit www.oracle.com if you need additional information or have any
  23 #  questions.
  24 #
  25 
  26 ##
  27 ## @test
  28 ## @bug 8148353
  29 ## @summary gcc on sparc expects clean 32 bit int in 64 bit register on function entry
  30 ## @run shell/timeout=30 TestDirtyInt.sh
  31 ##
  32 
  33 if [ "${TESTSRC}" = "" ]
  34 then
  35   TESTSRC=${PWD}
  36   echo "TESTSRC not set.  Using "${TESTSRC}" as default"
  37 fi
  38 echo "TESTSRC=${TESTSRC}"
  39 ## Adding common setup Variables for running shell tests.
  40 . ${TESTSRC}/../../test_env.sh
  41 
  42 # set platform-dependent variables
  43 if [ $VM_OS == "linux" -a $VM_CPU == "sparcv9" ]; then
  44     echo "Testing on linux-sparc"
  45     gcc_cmd=`which gcc`
  46     if [ "x$gcc_cmd" == "x" ]; then
  47         echo "WARNING: gcc not found. Cannot execute test." 2>&1
  48         exit 0;
  49     fi
  50 else
  51     echo "Test passed; only valid for linux-sparc"
  52     exit 0;
  53 fi
  54 
  55 THIS_DIR=.
  56 
  57 cp ${TESTSRC}${FS}*.java ${THIS_DIR}
  58 ${TESTJAVA}${FS}bin${FS}javac *.java
  59 
  60 $gcc_cmd -O1 -DLINUX -fPIC -shared \
  61     -o ${TESTSRC}${FS}libTestDirtyInt.so \
  62     -I${TESTJAVA}${FS}include \
  63     -I${TESTJAVA}${FS}include${FS}linux \
  64     ${TESTSRC}${FS}libTestDirtyInt.c
  65 
  66 # run the java test in the background
  67 cmd="${TESTJAVA}${FS}bin${FS}java \
  68     -Djava.library.path=${TESTSRC}${FS} TestDirtyInt"
  69 
  70 echo "$cmd"
  71 eval $cmd 
  72 
  73 if [ $? = 0 ]
  74 then
  75     echo "Test Passed"
  76     exit 0
  77 fi
  78 
  79 echo "Test Failed"
  80 exit 1


  13 #  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14 #  version 2 for more details (a copy is included in the LICENSE file that
  15 #  accompanied this code).
  16 #
  17 #  You should have received a copy of the GNU General Public License version
  18 #  2 along with this work; if not, write to the Free Software Foundation,
  19 #  Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 #
  21 #  Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 #  or visit www.oracle.com if you need additional information or have any
  23 #  questions.
  24 #
  25 
  26 ##
  27 ## @test
  28 ## @bug 8148353
  29 ## @summary gcc on sparc expects clean 32 bit int in 64 bit register on function entry
  30 ## @run shell/timeout=30 TestDirtyInt.sh
  31 ##
  32 
  33 if [ -z "${TESTSRC}" ]; then
  34     TESTSRC="${PWD}"
  35     echo "TESTSRC not set.  Using "${TESTSRC}" as default"

  36 fi
  37 echo "TESTSRC=${TESTSRC}"
  38 ## Adding common setup Variables for running shell tests.
  39 . ${TESTSRC}/../../test_env.sh
  40 
  41 # set platform-dependent variables
  42 if [ "$VM_OS" = "linux" -a "$VM_CPU" = "sparcv9" ]; then
  43     echo "Testing on linux-sparc"
  44     gcc_cmd=`which gcc`
  45     if [ -z "$gcc_cmd" ]; then
  46         echo "WARNING: gcc not found. Cannot execute test." 2>&1
  47         exit 0;
  48     fi
  49 else
  50     echo "Test passed; only valid for linux-sparc"
  51     exit 0;
  52 fi
  53 
  54 THIS_DIR=.
  55 
  56 cp ${TESTSRC}${FS}*.java ${THIS_DIR}
  57 ${TESTJAVA}${FS}bin${FS}javac *.java
  58 
  59 $gcc_cmd -O1 -DLINUX -fPIC -shared \
  60     -o ${TESTSRC}${FS}libTestDirtyInt.so \
  61     -I${TESTJAVA}${FS}include \
  62     -I${TESTJAVA}${FS}include${FS}linux \
  63     ${TESTSRC}${FS}libTestDirtyInt.c
  64 
  65 # run the java test in the background
  66 cmd="${TESTJAVA}${FS}bin${FS}java \
  67     -Djava.library.path=${TESTSRC}${FS} TestDirtyInt"
  68 
  69 echo "$cmd"
  70 eval $cmd
  71 
  72 if [ $? = 0 ]; then

  73     echo "Test Passed"
  74     exit 0
  75 fi
  76 
  77 echo "Test Failed"
  78 exit 1
< prev index next >