annotate test/compiler/5091921/Test7005594.sh @ 3872:ff9ab6327924

7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS Summary: Run test only on systems with 2Gbyte or more memory. Don't zap heap to reduce execution time. Reviewed-by: iveresov
author kvn
date Sat, 20 Aug 2011 14:03:12 -0700
parents 231c2b41ea4d
children 04d6d4322c6a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3386
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
1 #!/bin/sh
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
2 #
231c2b41ea4d 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.
231c2b41ea4d 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.
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
5 #
231c2b41ea4d 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
231c2b41ea4d 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
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
8 # published by the Free Software Foundation.
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
9 #
231c2b41ea4d 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
231c2b41ea4d 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
231c2b41ea4d 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
231c2b41ea4d 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
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
14 # accompanied this code).
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
15 #
231c2b41ea4d 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
231c2b41ea4d 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,
231c2b41ea4d 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.
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
19 #
231c2b41ea4d 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
231c2b41ea4d 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
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
22 # questions.
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
23 #
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
24 #
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
25
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
26 if [ "${TESTSRC}" = "" ]
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
27 then
231c2b41ea4d 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."
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
29 exit 1
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
30 fi
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
31 echo "TESTSRC=${TESTSRC}"
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
32 if [ "${TESTJAVA}" = "" ]
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
33 then
231c2b41ea4d 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."
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
35 exit 1
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
36 fi
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
37 echo "TESTJAVA=${TESTJAVA}"
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
38 if [ "${TESTCLASSES}" = "" ]
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
39 then
231c2b41ea4d 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."
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
41 exit 1
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
42 fi
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
43 echo "TESTCLASSES=${TESTCLASSES}"
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
44 echo "CLASSPATH=${CLASSPATH}"
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
45
3872
ff9ab6327924 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 3386
diff changeset
46 # Amount of physical memory in megabytes
ff9ab6327924 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 3386
diff changeset
47 MEM=0
ff9ab6327924 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 3386
diff changeset
48 if [ -f "/proc/meminfo" ]; then
ff9ab6327924 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 3386
diff changeset
49 # Linux, Windows/Cygwin
ff9ab6327924 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 3386
diff changeset
50 MEM=`cat /proc/meminfo |grep ^MemTotal: | awk '{print $2}'`
ff9ab6327924 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 3386
diff changeset
51 MEM="$(($MEM / 1024))"
ff9ab6327924 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 3386
diff changeset
52 elif [ -x "/usr/sbin/prtconf" ]; then
ff9ab6327924 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 3386
diff changeset
53 # Solaris
ff9ab6327924 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 3386
diff changeset
54 MEM=`/usr/sbin/prtconf | grep "^Memory size" | awk '{print $3}'`
ff9ab6327924 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 3386
diff changeset
55 elif [ -x "/usr/sbin/system_profiler" ]; then
ff9ab6327924 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 3386
diff changeset
56 # MacOS
ff9ab6327924 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 3386
diff changeset
57 MEMo=`/usr/sbin/system_profiler SPHardwareDataType | grep Memory:`
ff9ab6327924 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 3386
diff changeset
58 MEM=`echo "$MEMo" | awk '{print $2}'`
ff9ab6327924 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 3386
diff changeset
59 MEMu=`echo "$MEMo" | awk '{print $3}'`
ff9ab6327924 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 3386
diff changeset
60 case $MEMu in
ff9ab6327924 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 3386
diff changeset
61 GB)
ff9ab6327924 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 3386
diff changeset
62 MEM="$(($MEM * 1024))"
ff9ab6327924 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 3386
diff changeset
63 ;;
ff9ab6327924 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 3386
diff changeset
64 MB)
ff9ab6327924 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 3386
diff changeset
65 ;;
ff9ab6327924 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 3386
diff changeset
66 *)
ff9ab6327924 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 3386
diff changeset
67 echo "Unknown memory unit in system_profile output: $MEMu"
ff9ab6327924 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 3386
diff changeset
68 ;;
ff9ab6327924 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 3386
diff changeset
69 esac
ff9ab6327924 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 3386
diff changeset
70 elif [ -n "$ROOTDIR" -a -x "$ROOTDIR/mksnt/sysinf" ]; then
ff9ab6327924 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 3386
diff changeset
71 # Windows/MKS
ff9ab6327924 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 3386
diff changeset
72 MEM=`"$ROOTDIR/mksnt/sysinf" memory -v | grep "Total Physical Memory: " | sed 's/Total Physical Memory: *//g'`
ff9ab6327924 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 3386
diff changeset
73 MEM="$(($machine_memory / 1024))"
ff9ab6327924 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 3386
diff changeset
74 else
ff9ab6327924 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 3386
diff changeset
75 echo "Unable to determine amount of physical memory on the machine"
ff9ab6327924 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 3386
diff changeset
76 fi
ff9ab6327924 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 3386
diff changeset
77
ff9ab6327924 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 3386
diff changeset
78 if [ $MEM -lt 2000 ]; then
ff9ab6327924 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 3386
diff changeset
79 echo "Test skipped due to low (or unknown) memory on the system: $MEM Mb"
ff9ab6327924 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 3386
diff changeset
80 exit 0
ff9ab6327924 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 3386
diff changeset
81 fi
ff9ab6327924 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 3386
diff changeset
82
ff9ab6327924 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 3386
diff changeset
83 echo "MEMORY=$MEM Mb"
ff9ab6327924 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 3386
diff changeset
84
3386
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
85 set -x
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
86
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
87 cp ${TESTSRC}/Test7005594.java .
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
88 cp ${TESTSRC}/Test7005594.sh .
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
89
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
90 ${TESTJAVA}/bin/javac -d . Test7005594.java
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
91
3872
ff9ab6327924 7076831: TEST_BUG: compiler/5091921/Test7005594.java fails on LOW MEM SYSTEMS
kvn
parents: 3386
diff changeset
92 ${TESTJAVA}/bin/java ${TESTVMOPTS} -Xms1600m -XX:+IgnoreUnrecognizedVMOptions -XX:-ZapUnusedHeapArea -Xcomp -XX:CompileOnly=Test7005594.test Test7005594 > test.out 2>&1
3386
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
93
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
94 result=$?
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
95
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
96 cat test.out
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
97
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
98 if [ $result -eq 95 ]
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
99 then
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
100 echo "Passed"
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
101 exit 0
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
102 fi
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
103
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
104 if [ $result -eq 97 ]
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
105 then
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
106 echo "Failed"
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
107 exit 1
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
108 fi
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
109
231c2b41ea4d 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
231c2b41ea4d 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
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
112 if [ $? = 0 ]
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
113 then
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
114 echo "Passed"
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
115 exit 0
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
116 else
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
117 echo "Failed"
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
118 exit 1
231c2b41ea4d 7045570: compiler/5091921/Test7005594.java failed because not enough space for object heap
kvn
parents:
diff changeset
119 fi