Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/test/runtime/8001071/Test8001071.sh
32284 views
#!/bin/sh12# Copyright (c) 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.2223## @test24## @bug 800107125## @summary Add simple range check into VM implemenation of Unsafe access methods26## @compile Test8001071.java27## @run shell Test8001071.sh28## @author [email protected]2930VERSION=`${TESTJAVA}/bin/java ${TESTVMOPTS} -version 2>&1`3132if [ -n "`echo $VERSION | grep debug`" -o -n "`echo $VERSION | grep jvmg`" ]; then33echo "Build type check passed"34echo "Continue testing"35else36echo "Fastdebug build is required for this test"37exit 038fi3940${TESTJAVA}/bin/java -cp ${TESTCLASSES} ${TESTVMOPTS} Test8001071 2>&14142HS_ERR_FILE=hs_err_pid*.log4344if [ ! -f $HS_ERR_FILE ]45then46echo "hs_err_pid log file was not found"47echo "Test failed"48exit 149fi5051grep "assert(byte_offset < p_size) failed: Unsafe access: offset.*> object's size.*" $HS_ERR_FILE5253if [ "0" = "$?" ];54then55echo "Range check assertion failed as expected"56echo "Test passed"57exit 058else59echo "Range check assertion was not failed"60echo "Test failed"61exit 162fi636465