hotspot/test/runtime/6878713/Test6878713.sh
changeset 8481 42a79b703814
child 12729 684b5857e506
equal deleted inserted replaced
8480:2858637fddce 8481:42a79b703814
       
     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 BIT_FLAG=""
       
    29 
       
    30 # set platform-dependent variables
       
    31 OS=`uname -s`
       
    32 case "$OS" in
       
    33   SunOS | Linux )
       
    34     NULL=/dev/null
       
    35     PS=":"
       
    36     FS="/"
       
    37     ## for solaris, linux it's HOME
       
    38     FILE_LOCATION=$HOME
       
    39     if [ -f ${FILE_LOCATION}${FS}JDK64BIT -a ${OS} = "SunOS" ]
       
    40     then
       
    41         BIT_FLAG=`cat ${FILE_LOCATION}${FS}JDK64BIT | grep -v '^#'`
       
    42     fi
       
    43     ;;
       
    44   Windows_* )
       
    45     NULL=NUL
       
    46     PS=";"
       
    47     FS="\\"
       
    48     ;;
       
    49   * )
       
    50     echo "Unrecognized system!"
       
    51     exit 1;
       
    52     ;;
       
    53 esac
       
    54 
       
    55 JEMMYPATH=${CPAPPEND}
       
    56 CLASSPATH=.${PS}${TESTCLASSES}${PS}${JEMMYPATH} ; export CLASSPATH
       
    57 
       
    58 THIS_DIR=`pwd`
       
    59 
       
    60 ${TESTJAVA}${FS}bin${FS}java ${BIT_FLAG} -version
       
    61 
       
    62 ${TESTJAVA}${FS}bin${FS}jar xvf ${TESTSRC}${FS}testcase.jar
       
    63 
       
    64 ${TESTJAVA}${FS}bin${FS}java ${BIT_FLAG} OOMCrashClass1960_2 > test.out 2>&1
       
    65 
       
    66 if [ -s core -o -s "hs_*.log" ]
       
    67 then
       
    68     cat hs*.log
       
    69     echo "Test Failed"
       
    70     exit 1
       
    71 else
       
    72     echo "Test Passed"
       
    73     exit 0
       
    74 fi