hotspot/test/compiler/5091921/Test7005594.sh
author ohair
Mon, 30 Apr 2012 16:03:40 -0700
changeset 12484 106e8b1b0eb3
parent 10285 21965ee594b9
child 16457 92af83361777
permissions -rw-r--r--
7165312: Fix jaxp source movement for new build-infra Reviewed-by: ohrstrom
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9944
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
     1
#!/bin/sh
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
     2
# 
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
     3
# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
     4
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
     5
# 
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
     6
# This code is free software; you can redistribute it and/or modify it
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
     7
# under the terms of the GNU General Public License version 2 only, as
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
     8
# published by the Free Software Foundation.
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
     9
# 
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    10
# This code is distributed in the hope that it will be useful, but WITHOUT
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    11
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    12
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    13
# version 2 for more details (a copy is included in the LICENSE file that
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    14
# accompanied this code).
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    15
# 
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    16
# You should have received a copy of the GNU General Public License version
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    17
# 2 along with this work; if not, write to the Free Software Foundation,
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    18
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    19
# 
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    20
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    21
# or visit www.oracle.com if you need additional information or have any
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    22
# questions.
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    23
# 
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    24
# 
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    25
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    26
if [ "${TESTSRC}" = "" ]
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    27
then
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    28
  echo "TESTSRC not set.  Test cannot execute.  Failed."
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    29
  exit 1
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    30
fi
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    31
echo "TESTSRC=${TESTSRC}"
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    32
if [ "${TESTJAVA}" = "" ]
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    33
then
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    34
  echo "TESTJAVA not set.  Test cannot execute.  Failed."
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    35
  exit 1
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    36
fi
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    37
echo "TESTJAVA=${TESTJAVA}"
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    38
if [ "${TESTCLASSES}" = "" ]
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    39
then
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    40
  echo "TESTCLASSES not set.  Test cannot execute.  Failed."
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    41
  exit 1
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    42
fi
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    43
echo "TESTCLASSES=${TESTCLASSES}"
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    44
echo "CLASSPATH=${CLASSPATH}"
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    45
10285
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    46
# Amount of physical memory in megabytes
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    47
MEM=0
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    48
if [ -f "/proc/meminfo" ]; then
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    49
  # Linux, Windows/Cygwin
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    50
  MEM=`cat /proc/meminfo |grep ^MemTotal: | awk '{print $2}'`
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    51
  MEM="$(($MEM / 1024))"
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    52
elif [ -x "/usr/sbin/prtconf" ]; then
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    53
  # Solaris
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    54
  MEM=`/usr/sbin/prtconf | grep "^Memory size" | awk '{print $3}'`
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    55
elif [ -x "/usr/sbin/system_profiler" ]; then
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    56
  # MacOS
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    57
  MEMo=`/usr/sbin/system_profiler SPHardwareDataType | grep Memory:`
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    58
  MEM=`echo "$MEMo" | awk '{print $2}'`
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    59
  MEMu=`echo "$MEMo" | awk '{print $3}'`
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    60
  case $MEMu in
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    61
  GB)
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    62
    MEM="$(($MEM * 1024))"
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    63
    ;;
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    64
  MB)
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    65
    ;;
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    66
  *)
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    67
    echo "Unknown memory unit in system_profile output: $MEMu"
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    68
    ;;
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    69
  esac
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    70
elif [ -n "$ROOTDIR" -a -x "$ROOTDIR/mksnt/sysinf" ]; then
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    71
  # Windows/MKS
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    72
  MEM=`"$ROOTDIR/mksnt/sysinf" memory -v | grep "Total Physical Memory: " | sed 's/Total Physical Memory: *//g'`
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    73
  MEM="$(($machine_memory / 1024))"
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    74
else
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    75
  echo "Unable to determine amount of physical memory on the machine"
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    76
fi
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    77
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    78
if [ $MEM -lt 2000 ]; then
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    79
  echo "Test skipped due to low (or unknown) memory on the system: $MEM Mb"
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    80
  exit 0
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    81
fi
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    82
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    83
echo "MEMORY=$MEM Mb"
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    84
9944
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    85
set -x
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    86
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    87
cp ${TESTSRC}/Test7005594.java .
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    88
cp ${TESTSRC}/Test7005594.sh .
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    89
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    90
${TESTJAVA}/bin/javac -d . Test7005594.java
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    91
10285
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    92
${TESTJAVA}/bin/java ${TESTVMOPTS} -Xms1600m -XX:+IgnoreUnrecognizedVMOptions -XX:-ZapUnusedHeapArea -Xcomp -XX:CompileOnly=Test7005594.test Test7005594 > test.out 2>&1
9944
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    93
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    94
result=$?
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    95
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    96
cat test.out
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    97
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    98
if [ $result -eq 95 ]
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    99
then
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
   100
  echo "Passed"
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
   101
  exit 0
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
   102
fi
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
   103
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
   104
if [ $result -eq 97 ]
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
   105
then
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
   106
  echo "Failed"
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
   107
  exit 1
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
   108
fi
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
   109
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
   110
# The test should pass when no enough space for object heap
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
   111
grep "Could not reserve enough space for object heap" test.out
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
   112
if [ $? = 0 ]
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
   113
then
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
   114
  echo "Passed"
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
   115
  exit 0
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
   116
else
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
   117
  echo "Failed"
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
   118
  exit 1
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
   119
fi