Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/test/java/lang/annotation/loaderLeak/LoaderLeak.sh
38828 views
#!/bin/sh12# Copyright (c) 2004, 2012, 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.2223if [ "${TESTSRC}" = "" ]24then25echo "TESTSRC not set. Test cannot execute. Failed."26exit 127fi28echo "TESTSRC=${TESTSRC}"29if [ "${TESTJAVA}" = "" ]30then31echo "TESTJAVA not set. Test cannot execute. Failed."32exit 133fi34echo "TESTJAVA=${TESTJAVA}"35if [ "${COMPILEJAVA}" = "" ]; then36COMPILEJAVA="${TESTJAVA}"37fi38echo "COMPILEJAVA=${COMPILEJAVA}"39if [ "${TESTCLASSES}" = "" ]40then41echo "TESTCLASSES not set. Test cannot execute. Failed."42exit 143fi44echo "TESTCLASSES=${TESTCLASSES}"45echo "CLASSPATH=${CLASSPATH}"4647# set platform-dependent variables48OS=`uname -s`49case "$OS" in50SunOS | Linux | Darwin | AIX )51NULL=/dev/null52PS=":"53FS="/"54;;55CYGWIN* )56NULL=/dev/null57PS=";"58FS="/"59;;60Windows* )61NULL=NUL62PS=";"63FS="\\"64;;65* )66echo "Unrecognized system!"67exit 1;68;;69esac7071mkdir -p classes72cp ${TESTSRC}${FS}*.java .73${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d classes A.java B.java C.java74${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} Main.java75${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} Main76result=$?77if [ $result -eq 0 ]78then79echo "Passed 1 of 2"80else81echo "Failed 1 of 2"82exit $result83fi84${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} Main foo85result=$?86if [ $result -eq 0 ]87then88echo "Passed 2 of 2"89else90echo "Failed 2 of 2"91fi92exit $result939495