Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/test/compiler/5091921/Test7005594.sh
32285 views
#!/bin/sh1#2# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.4#5# This code is free software; you can redistribute it and/or modify it6# under the terms of the GNU General Public License version 2 only, as7# published by the Free Software Foundation.8#9# This code is distributed in the hope that it will be useful, but WITHOUT10# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or11# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License12# version 2 for more details (a copy is included in the LICENSE file that13# accompanied this code).14#15# You should have received a copy of the GNU General Public License version16# 2 along with this work; if not, write to the Free Software Foundation,17# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.18#19# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA20# or visit www.oracle.com if you need additional information or have any21# questions.22#23#24## some tests require path to find test source dir25if [ "${TESTSRC}" = "" ]26then27TESTSRC=${PWD}28echo "TESTSRC not set. Using "${TESTSRC}" as default"29fi30echo "TESTSRC=${TESTSRC}"31## Adding common setup Variables for running shell tests.32. ${TESTSRC}/../../test_env.sh3334# Amount of physical memory in megabytes35MEM=036if [ -f "/proc/meminfo" ]; then37# Linux, Windows/Cygwin38MEM=`cat /proc/meminfo |grep ^MemTotal: | awk '{print $2}'`39MEM="$(($MEM / 1024))"40elif [ -x "/usr/sbin/prtconf" ]; then41# Solaris42MEM=`/usr/sbin/prtconf | grep "^Memory size" | awk '{print $3}'`43elif [ -x "/usr/sbin/system_profiler" ]; then44# MacOS45MEMo=`/usr/sbin/system_profiler SPHardwareDataType | grep Memory:`46MEM=`echo "$MEMo" | awk '{print $2}'`47MEMu=`echo "$MEMo" | awk '{print $3}'`48case $MEMu in49GB)50MEM="$(($MEM * 1024))"51;;52MB)53;;54*)55echo "Unknown memory unit in system_profile output: $MEMu"56;;57esac58elif [ -n "$ROOTDIR" -a -x "$ROOTDIR/mksnt/sysinf" ]; then59# Windows/MKS60MEM=`"$ROOTDIR/mksnt/sysinf" memory -v | grep "Total Physical Memory: " | sed 's/Total Physical Memory: *//g'`61MEM="$(($machine_memory / 1024))"62else63echo "Unable to determine amount of physical memory on the machine"64fi6566if [ $MEM -lt 2000 ]; then67echo "Test skipped due to low (or unknown) memory on the system: $MEM Mb"68exit 069fi7071echo "MEMORY=$MEM Mb"7273set -x7475cp ${TESTSRC}/Test7005594.java .76cp ${TESTSRC}/Test7005594.sh .7778${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} -d . Test7005594.java7980${TESTJAVA}/bin/java ${TESTVMOPTS} -Xmx1600m -Xms1600m -XX:+IgnoreUnrecognizedVMOptions -XX:-ZapUnusedHeapArea -Xcomp -XX:CompileOnly=Test7005594.test Test7005594 > test.out 2>&18182result=$?8384cat test.out8586if [ $result -eq 95 ]87then88echo "Passed"89exit 090fi9192if [ $result -eq 97 ]93then94echo "Failed"95exit 196fi9798# The test should pass when no enough space for object heap99grep "Could not reserve enough space for .*object heap" test.out100if [ $? = 0 ]101then102echo "Passed"103exit 0104else105echo "Failed"106exit 1107fi108109110