Path: blob/jdk8u272-b10-aarch32-20201026/hotspot/test/runtime/7162488/Test7162488.sh
48795 views
#1# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.2# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3#4# This code is free software; you can redistribute it and/or modify it5# under the terms of the GNU General Public License version 2 only, as6# published by the Free Software Foundation.7#8# This code is distributed in the hope that it will be useful, but WITHOUT9# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11# version 2 for more details (a copy is included in the LICENSE file that12# accompanied this code).13#14# You should have received a copy of the GNU General Public License version15# 2 along with this work; if not, write to the Free Software Foundation,16# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17#18# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19# or visit www.oracle.com if you need additional information or have any20# questions.21#222324# @test Test7162488.sh25# @bug 716248826# @summary VM not printing unknown -XX options27# @run shell Test7162488.sh28#2930if [ "${TESTSRC}" = "" ]31then32TESTSRC=${PWD}33echo "TESTSRC not set. Using "${TESTSRC}" as default"34fi35echo "TESTSRC=${TESTSRC}"36## Adding common setup Variables for running shell tests.37. ${TESTSRC}/../../test_env.sh3839JAVA=${TESTJAVA}${FS}bin${FS}java4041#42# Just run with an option we are confident will not be recognized,43# and check for the message:44#45OPTION=this_is_not_an_option4647${JAVA} ${TESTVMOPTS} -showversion -XX:${OPTION} 2>&1 | grep "Unrecognized VM option"48if [ "$?" != "0" ]49then50printf "FAILED: option not flagged as unrecognized.\n"51exit 152fi5354${JAVA} ${TESTVMOPTS} -showversion -XX:${OPTION} 2>&1 | grep ${OPTION}55if [ "$?" != "0" ]56then57printf "FAILED: bad option not named as being bad.\n"58exit 159fi6061printf "Passed.\n"62636465