Thu, 18 Jul 2013 03:38:10 -0700
Added tag jdk8-b99 for changeset 81b6cb70717c
hseigel@4523 | 1 | # |
hseigel@4523 | 2 | # Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. |
hseigel@4523 | 3 | # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
hseigel@4523 | 4 | # |
hseigel@4523 | 5 | # This code is free software; you can redistribute it and/or modify it |
hseigel@4523 | 6 | # under the terms of the GNU General Public License version 2 only, as |
hseigel@4523 | 7 | # published by the Free Software Foundation. |
hseigel@4523 | 8 | # |
hseigel@4523 | 9 | # This code is distributed in the hope that it will be useful, but WITHOUT |
hseigel@4523 | 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
hseigel@4523 | 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
hseigel@4523 | 12 | # version 2 for more details (a copy is included in the LICENSE file that |
hseigel@4523 | 13 | # accompanied this code). |
hseigel@4523 | 14 | # |
hseigel@4523 | 15 | # You should have received a copy of the GNU General Public License version |
hseigel@4523 | 16 | # 2 along with this work; if not, write to the Free Software Foundation, |
hseigel@4523 | 17 | # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
hseigel@4523 | 18 | # |
hseigel@4523 | 19 | # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
hseigel@4523 | 20 | # or visit www.oracle.com if you need additional information or have any |
hseigel@4523 | 21 | # questions. |
hseigel@4523 | 22 | # |
hseigel@4523 | 23 | |
hseigel@4523 | 24 | |
hseigel@4523 | 25 | # @test Test8000968.sh |
hseigel@4523 | 26 | # @bug 8000968 |
hseigel@4523 | 27 | # @summary NPG: UseCompressedKlassPointers asserts with ObjectAlignmentInBytes=32 |
hseigel@4523 | 28 | # @run shell Test8000968.sh |
hseigel@4523 | 29 | # |
hseigel@4523 | 30 | |
hseigel@4523 | 31 | if [ "${TESTJAVA}" = "" ] |
hseigel@4523 | 32 | then |
hseigel@4523 | 33 | PARENT=`dirname \`which java\`` |
hseigel@4523 | 34 | TESTJAVA=`dirname ${PARENT}` |
hseigel@4523 | 35 | printf "TESTJAVA not set, selecting " ${TESTJAVA} |
hseigel@4523 | 36 | printf " If this is incorrect, try setting the variable manually.\n" |
hseigel@4523 | 37 | fi |
hseigel@4523 | 38 | |
hseigel@4523 | 39 | |
hseigel@4523 | 40 | # set platform-dependent variables |
hseigel@4523 | 41 | OS=`uname -s` |
hseigel@4523 | 42 | case "$OS" in |
hseigel@4523 | 43 | Windows_* ) |
hseigel@4523 | 44 | FS="\\" |
hseigel@4523 | 45 | NULL=NUL |
hseigel@4523 | 46 | ;; |
hseigel@4523 | 47 | * ) |
hseigel@4523 | 48 | FS="/" |
hseigel@4523 | 49 | NULL=/dev/null |
hseigel@4523 | 50 | ;; |
hseigel@4523 | 51 | esac |
hseigel@4523 | 52 | |
hseigel@4523 | 53 | JAVA=${TESTJAVA}${FS}bin${FS}java |
hseigel@4523 | 54 | |
hseigel@4523 | 55 | # |
hseigel@4523 | 56 | # See if platform has 64 bit java. |
hseigel@4523 | 57 | # |
hseigel@4523 | 58 | ${JAVA} ${TESTVMOPTS} -d64 -version 2>&1 | grep -i "does not support" > ${NULL} |
hseigel@4523 | 59 | if [ "$?" != "1" ] |
hseigel@4523 | 60 | then |
hseigel@4523 | 61 | printf "Platform is 32 bit, does not support -XX:ObjectAlignmentInBytes= option.\n" |
hseigel@4523 | 62 | printf "Passed.\n" |
hseigel@4523 | 63 | exit 0 |
hseigel@4523 | 64 | fi |
hseigel@4523 | 65 | |
hseigel@4523 | 66 | # |
hseigel@4523 | 67 | # Test -XX:ObjectAlignmentInBytes with -XX:+UseCompressedKlassPointers -XX:+UseCompressedOops. |
hseigel@4523 | 68 | # |
hseigel@4523 | 69 | ${JAVA} ${TESTVMOPTS} -d64 -XX:+UseCompressedKlassPointers -XX:+UseCompressedOops -XX:ObjectAlignmentInBytes=16 -version 2>&1 > ${NULL} |
hseigel@4523 | 70 | if [ "$?" != "0" ] |
hseigel@4523 | 71 | then |
hseigel@4523 | 72 | printf "FAILED: -XX:ObjectAlignmentInBytes=16 option did not work.\n" |
hseigel@4523 | 73 | exit 1 |
hseigel@4523 | 74 | fi |
hseigel@4523 | 75 | |
hseigel@4523 | 76 | ${JAVA} ${TESTVMOPTS} -d64 -XX:+UseCompressedKlassPointers -XX:+UseCompressedOops -XX:ObjectAlignmentInBytes=32 -version 2>&1 > ${NULL} |
hseigel@4523 | 77 | if [ "$?" != "0" ] |
hseigel@4523 | 78 | then |
hseigel@4523 | 79 | printf "FAILED: -XX:ObjectAlignmentInBytes=32 option did not work.\n" |
hseigel@4523 | 80 | exit 1 |
hseigel@4523 | 81 | fi |
hseigel@4523 | 82 | |
hseigel@4523 | 83 | ${JAVA} ${TESTVMOPTS} -d64 -XX:+UseCompressedKlassPointers -XX:+UseCompressedOops -XX:ObjectAlignmentInBytes=64 -version 2>&1 > ${NULL} |
hseigel@4523 | 84 | if [ "$?" != "0" ] |
hseigel@4523 | 85 | then |
hseigel@4523 | 86 | printf "FAILED: -XX:ObjectAlignmentInBytes=64 option did not work.\n" |
hseigel@4523 | 87 | exit 1 |
hseigel@4523 | 88 | fi |
hseigel@4523 | 89 | |
hseigel@4523 | 90 | ${JAVA} ${TESTVMOPTS} -d64 -XX:+UseCompressedKlassPointers -XX:+UseCompressedOops -XX:ObjectAlignmentInBytes=128 -version 2>&1 > ${NULL} |
hseigel@4523 | 91 | if [ "$?" != "0" ] |
hseigel@4523 | 92 | then |
hseigel@4523 | 93 | printf "FAILED: -XX:ObjectAlignmentInBytes=128 option did not work.\n" |
hseigel@4523 | 94 | exit 1 |
hseigel@4523 | 95 | fi |
hseigel@4523 | 96 | |
hseigel@4523 | 97 | |
hseigel@4523 | 98 | printf "Passed.\n" |
hseigel@4523 | 99 | exit 0 |