source: trunk/openjdk/hotspot/test/runtime/7020373/Test7020373.sh

Last change on this file was 309, checked in by dmik, 14 years ago

trunk: Merged in openjdk6 b24 from branches/vendor/oracle.

  • Property svn:eol-style set to native
File size: 1.6 KB
Line 
1#!/bin/sh
2
3##
4## @test
5## @bug 7020373
6## @key cte_test
7## @summary JSR rewriting can overflow memory address size variables
8## @run shell Test7020373.sh
9##
10
11if [ "${TESTSRC}" = "" ]
12then TESTSRC=.
13fi
14
15if [ "${TESTJAVA}" = "" ]
16then
17 PARENT=`dirname \`which java\``
18 TESTJAVA=`dirname ${PARENT}`
19 echo "TESTJAVA not set, selecting " ${TESTJAVA}
20 echo "If this is incorrect, try setting the variable manually."
21fi
22
23if [ "${TESTCLASSES}" = "" ]
24then
25 echo "TESTCLASSES not set. Test cannot execute. Failed."
26 exit 1
27fi
28
29BIT_FLAG=""
30
31# set platform-dependent variables
32OS=`uname -s`
33case "$OS" in
34 SunOS | Linux )
35 NULL=/dev/null
36 PS=":"
37 FS="/"
38 ## for solaris, linux it's HOME
39 FILE_LOCATION=$HOME
40 if [ -f ${FILE_LOCATION}${FS}JDK64BIT -a ${OS} = "SunOS" ]
41 then
42 BIT_FLAG=`cat ${FILE_LOCATION}${FS}JDK64BIT | grep -v '^#'`
43 fi
44 ;;
45 Windows_* )
46 NULL=NUL
47 PS=";"
48 FS="\\"
49 ;;
50 * )
51 echo "Unrecognized system!"
52 exit 1;
53 ;;
54esac
55
56JEMMYPATH=${CPAPPEND}
57CLASSPATH=.${PS}${TESTCLASSES}${PS}${JEMMYPATH} ; export CLASSPATH
58
59THIS_DIR=`pwd`
60
61${TESTJAVA}${FS}bin${FS}java ${BIT_FLAG} -version
62
63${TESTJAVA}${FS}bin${FS}jar xvf ${TESTSRC}${FS}testcase.jar
64
65${TESTJAVA}${FS}bin${FS}java ${BIT_FLAG} OOMCrashClass4000_1 > test.out 2>&1
66
67cat test.out
68
69egrep "SIGSEGV|An unexpected error has been detected" test.out
70
71if [ $? = 0 ]
72then
73 echo "Test Failed"
74 exit 1
75else
76 grep "java.lang.LinkageError" test.out
77 if [ $? = 0 ]
78 then
79 echo "Test Passed"
80 exit 0
81 else
82 echo "Test Failed"
83 exit 1
84 fi
85fi
Note: See TracBrowser for help on using the repository browser.