hotspot/test/compiler/5091921/Test7005594.sh
author pchelko
Mon, 16 Jun 2014 17:13:58 +0400
changeset 25197 533f45be322f
parent 24676 1db7e277df87
child 25924 4c3dd8541530
permissions -rw-r--r--
8046221: [TEST_BUG] Cleanup datatransfer tests Reviewed-by: anthony, alexsch
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
# 
22234
da823d78ad65 8029233: Update copyright year to match last edit in jdk8 hotspot repository for 2013
mikael
parents: 16457
diff changeset
     3
# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
9944
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
# 
16457
92af83361777 8009152: A number of jtreg tests need review/improvement
collins
parents: 10285
diff changeset
    25
## some tests require path to find test source dir
9944
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
16457
92af83361777 8009152: A number of jtreg tests need review/improvement
collins
parents: 10285
diff changeset
    28
  TESTSRC=${PWD}
92af83361777 8009152: A number of jtreg tests need review/improvement
collins
parents: 10285
diff changeset
    29
  echo "TESTSRC not set.  Using "${TESTSRC}" as default"
9944
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}"
16457
92af83361777 8009152: A number of jtreg tests need review/improvement
collins
parents: 10285
diff changeset
    32
## Adding common setup Variables for running shell tests.
92af83361777 8009152: A number of jtreg tests need review/improvement
collins
parents: 10285
diff changeset
    33
. ${TESTSRC}/../../test_env.sh
9944
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    34
10285
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    35
# Amount of physical memory in megabytes
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    36
MEM=0
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    37
if [ -f "/proc/meminfo" ]; then
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    38
  # Linux, Windows/Cygwin
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    39
  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
    40
  MEM="$(($MEM / 1024))"
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    41
elif [ -x "/usr/sbin/prtconf" ]; then
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    42
  # Solaris
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    43
  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
    44
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
    45
  # MacOS
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    46
  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
    47
  MEM=`echo "$MEMo" | awk '{print $2}'`
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    48
  MEMu=`echo "$MEMo" | awk '{print $3}'`
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    49
  case $MEMu in
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    50
  GB)
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
    ;;
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    53
  MB)
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    54
    ;;
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    55
  *)
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    56
    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
    57
    ;;
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    58
  esac
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    59
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
    60
  # Windows/MKS
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    61
  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
    62
  MEM="$(($machine_memory / 1024))"
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    63
else
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    64
  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
    65
fi
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
if [ $MEM -lt 2000 ]; then
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    68
  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
    69
  exit 0
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    70
fi
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    71
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    72
echo "MEMORY=$MEM Mb"
21965ee594b9 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 9944
diff changeset
    73
9944
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    74
set -x
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    75
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    76
cp ${TESTSRC}/Test7005594.java .
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    77
cp ${TESTSRC}/Test7005594.sh .
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    78
16457
92af83361777 8009152: A number of jtreg tests need review/improvement
collins
parents: 10285
diff changeset
    79
${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} -d . Test7005594.java
9944
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    80
24676
1db7e277df87 8043899: compiler/5091921/Test7005594.java fails if specified -Xmx is less than 1600m
iignatyev
parents: 22234
diff changeset
    81
${TESTJAVA}/bin/java ${TESTVMOPTS} -Xmx1600m -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
    82
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    83
result=$?
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    84
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    85
cat test.out
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
if [ $result -eq 95 ]
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    88
then
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    89
  echo "Passed"
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    90
  exit 0
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    91
fi
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    92
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    93
if [ $result -eq 97 ]
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    94
then
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    95
  echo "Failed"
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    96
  exit 1
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    97
fi
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    98
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
    99
# The test should pass when no enough space for object heap
24676
1db7e277df87 8043899: compiler/5091921/Test7005594.java fails if specified -Xmx is less than 1600m
iignatyev
parents: 22234
diff changeset
   100
grep "Could not reserve enough space for .*object heap" test.out
9944
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
   101
if [ $? = 0 ]
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
   102
then
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
   103
  echo "Passed"
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
   104
  exit 0
cd527b70bfe4 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
   105
else
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