1 #!/bin/sh
   2 
   3 ##
   4 ## @test
   5 ## @bug 6878713
   6 ## @summary Verifier heap corruption, relating to backward jsrs
   7 ## @run shell/timeout=120 Test6878713.sh
   8 ##
   9 
  10 if [ "${TESTSRC}" = "" ]
  11 then TESTSRC=.
  12 fi
  13 
  14 if [ "${TESTJAVA}" = "" ]
  15 then
  16   PARENT=`dirname \`which java\``
  17   TESTJAVA=`dirname ${PARENT}`
  18   echo "TESTJAVA not set, selecting " ${TESTJAVA}
  19   echo "If this is incorrect, try setting the variable manually."
  20 fi
  21 
  22 if [ "${TESTCLASSES}" = "" ]
  23 then
  24   echo "TESTCLASSES not set.  Test cannot execute.  Failed."
  25   exit 1
  26 fi
  27 
  28 # set platform-dependent variables
  29 OS=`uname -s`
  30 case "$OS" in
  31   SunOS | Linux )
  32     NULL=/dev/null
  33     PS=":"
  34     FS="/"
  35     ;;
  36   Windows_* )
  37     NULL=NUL
  38     PS=";"
  39     FS="\\"
  40     ;;
  41   * )
  42     echo "Unrecognized system!"
  43     exit 1;
  44     ;;
  45 esac
  46 
  47 JEMMYPATH=${CPAPPEND}
  48 CLASSPATH=.${PS}${TESTCLASSES}${PS}${JEMMYPATH} ; export CLASSPATH
  49 
  50 THIS_DIR=`pwd`
  51 
  52 ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -version
  53 
  54 ${TESTJAVA}${FS}bin${FS}jar xvf ${TESTSRC}${FS}testcase.jar
  55 
  56 ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} OOMCrashClass1960_2 > test.out 2>&1
  57 
  58 if [ -s core -o -s "hs_*.log" ]
  59 then
  60     cat hs*.log
  61     echo "Test Failed"
  62     exit 1
  63 else
  64     echo "Test Passed"
  65     exit 0
  66 fi