hotspot/test/runtime/8001071/Test8001071.sh
author jlaskey
Tue, 23 Jul 2013 12:00:29 -0300
changeset 19089 51cfdcf21d35
parent 18503 9b63bbd77921
child 18711 af4f64192d31
permissions -rw-r--r--
8021130: Comments need to be tokens Reviewed-by: lagergren, attila Contributed-by: james.laskey@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
18503
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
     1
#!/bin/sh
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
     2
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
     3
# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
     4
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
     5
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
     6
# This code is free software; you can redistribute it and/or modify it
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
     7
# under the terms of the GNU General Public License version 2 only, as
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
     8
# published by the Free Software Foundation.
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
     9
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
    10
# This code is distributed in the hope that it will be useful, but WITHOUT
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
    11
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
    12
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
    13
# version 2 for more details (a copy is included in the LICENSE file that
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
    14
# accompanied this code).
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
    15
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
    16
# You should have received a copy of the GNU General Public License version
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
    17
# 2 along with this work; if not, write to the Free Software Foundation,
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
    18
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
    19
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
    20
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
    21
# or visit www.oracle.com if you need additional information or have any
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
    22
# questions.
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
    23
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
    24
## @test
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
    25
## @bug 8001071
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
    26
## @summary Add simple range check into VM implemenation of Unsafe access methods 
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
    27
## @compile Test8001071.java
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
    28
## @run shell Test8001071.sh
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
    29
## @author filipp.zhinkin@oracle.com
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
    30
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
    31
VERSION=`${TESTJAVA}/bin/java ${TESTVMOPTS} -version 2>&1`
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
    32
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
    33
if [ -n "`echo $VERSION | grep debug`" -o -n "`echo $VERSION | grep jvmg`" ]; then
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
    34
        echo "Build type check passed"
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
    35
        echo "Continue testing"
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
    36
else
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
    37
        echo "Fastdebug build is required for this test"
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
    38
        exit 0
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
    39
fi
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
    40
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
    41
${TESTJAVA}/bin/java -cp ${TESTCLASSES} ${TESTVMOPTS} Test8001071 2>&1
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
    42
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
    43
HS_ERR_FILE=hs_err_pid*.log
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
    44
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
    45
if [ ! -f $HS_ERR_FILE ]
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
    46
then
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
    47
    echo "hs_err_pid log file was not found"
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
    48
    echo "Test failed"
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
    49
    exit 1
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
    50
fi
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
    51
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
    52
grep "assert(byte_offset < p_size) failed: Unsafe access: offset.*> object's size.*" $HS_ERR_FILE
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
    53
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
    54
if [ "0" = "$?" ];
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
    55
then
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
    56
    echo "Range check assertion failed as expected"
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
    57
    echo "Test passed"
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
    58
    exit 0
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
    59
else
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
    60
    echo "Range check assertion was not failed"
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
    61
    echo "Test failed"
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
    62
    exit 1
9b63bbd77921 8006629: NEED_TEST: need test for JDK-8001071
kvn
parents:
diff changeset
    63
fi