Test7020373.sh 1.5 KB
Newer Older
1 2 3 4
#!/bin/sh

##
## @test
5
## @bug 7020373 7055247 7053586
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
## @key cte_test
## @summary JSR rewriting can overflow memory address size variables
## @run shell Test7020373.sh
##

if [ "${TESTSRC}" = "" ]
then TESTSRC=.
fi

if [ "${TESTJAVA}" = "" ]
then
  PARENT=`dirname \`which java\``
  TESTJAVA=`dirname ${PARENT}`
  echo "TESTJAVA not set, selecting " ${TESTJAVA}
  echo "If this is incorrect, try setting the variable manually."
fi

if [ "${TESTCLASSES}" = "" ]
then
  echo "TESTCLASSES not set.  Test cannot execute.  Failed."
  exit 1
fi

# set platform-dependent variables
OS=`uname -s`
case "$OS" in
32
  SunOS | Linux | Darwin )
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
    NULL=/dev/null
    PS=":"
    FS="/"
    ;;
  Windows_* )
    NULL=NUL
    PS=";"
    FS="\\"
    ;;
  * )
    echo "Unrecognized system!"
    exit 1;
    ;;
esac

JEMMYPATH=${CPAPPEND}
CLASSPATH=.${PS}${TESTCLASSES}${PS}${JEMMYPATH} ; export CLASSPATH

THIS_DIR=`pwd`

53
${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -version
54 55 56

${TESTJAVA}${FS}bin${FS}jar xvf ${TESTSRC}${FS}testcase.jar

57
${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} OOMCrashClass4000_1 > test.out 2>&1
58 59 60 61 62 63 64 65 66 67

cat test.out

egrep "SIGSEGV|An unexpected error has been detected" test.out

if [ $? = 0 ]
then
    echo "Test Failed"
    exit 1
else
68
    egrep "java.lang.LinkageError|java.lang.NoSuchMethodError|Main method not found in class OOMCrashClass4000_1|insufficient memory" test.out
69 70 71 72 73 74 75 76 77
    if [ $? = 0 ]
    then
        echo "Test Passed"
        exit 0
    else
        echo "Test Failed"
        exit 1
    fi
fi