1 #!/bin/sh 2 # 3 # Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. 4 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 5 # 6 # This code is free software; you can redistribute it and/or modify it 7 # under the terms of the GNU General Public License version 2 only, as 8 # published by the Free Software Foundation. 9 # 10 # This code is distributed in the hope that it will be useful, but WITHOUT 11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 13 # version 2 for more details (a copy is included in the LICENSE file that 14 # accompanied this code). 15 # 16 # You should have received a copy of the GNU General Public License version 17 # 2 along with this work; if not, write to the Free Software Foundation, 18 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 19 # 20 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 21 # or visit www.oracle.com if you need additional information or have any 22 # questions. 23 # 24 # 25 26 if [ "${TESTSRC}" = "" ] 27 then 28 echo "TESTSRC not set. Test cannot execute. Failed." 29 exit 1 30 fi 31 echo "TESTSRC=${TESTSRC}" 32 if [ "${TESTJAVA}" = "" ] 33 then 34 echo "TESTJAVA not set. Test cannot execute. Failed." 35 exit 1 36 fi 37 echo "TESTJAVA=${TESTJAVA}" 38 if [ "${TESTCLASSES}" = "" ] 39 then 40 echo "TESTCLASSES not set. Test cannot execute. Failed." 41 exit 1 42 fi 43 echo "TESTCLASSES=${TESTCLASSES}" 44 echo "CLASSPATH=${CLASSPATH}" 45 46 # set platform-dependent variables 47 OS=`uname -s` 48 case "$OS" in 49 SunOS | Linux | Darwin ) 50 NULL=/dev/null 51 PS=":" 52 FS="/" 53 ;; 54 Windows_* ) 55 NULL=NUL 56 PS=";" 57 FS="\\" 58 ;; 59 CYGWIN_* ) 60 NULL=/dev/null 61 PS=";" 62 FS="/" 63 ;; 64 * ) 65 echo "Unrecognized system!" 66 exit 1; 67 ;; 68 esac 69 70 71 ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -Xinternalversion | sed 's/amd64/x86/' | grep "x86" | grep "Server VM" | grep "debug" 72 73 # Only test fastdebug Server VM on x86 74 if [ $? != 0 ] 75 then 76 echo "Test Passed" 77 exit 0 78 fi 79 80 cp ${TESTSRC}${FS}TestIntVect.java . 81 ${TESTJAVA}${FS}bin${FS}javac -d . TestIntVect.java 82 83 ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -Xbatch -XX:-TieredCompilation -XX:CICompilerCount=1 -XX:+PrintCompilation -XX:+TraceNewVectors TestIntVect > test.out 2>&1 84 85 COUNT=`grep AddVI test.out | wc -l | awk '{print $1}'` 86 if [ $COUNT -lt 4 ] 87 then 88 echo "Test Failed: AddVI $COUNT < 4" 89 exit 1 90 fi 91 92 # AddVI is generated for test_subc 93 COUNT=`grep SubVI test.out | wc -l | awk '{print $1}'` 94 if [ $COUNT -lt 4 ] 95 then 96 echo "Test Failed: SubVI $COUNT < 4" 97 exit 1 98 fi 99 100 # LShiftVI+SubVI is generated for test_mulc 101 COUNT=`grep MulVI test.out | wc -l | awk '{print $1}'` 102 if [ $COUNT -lt 2 ] 103 then 104 echo "Test Failed: MulVI $COUNT < 2" 105 exit 1 106 fi 107 108 COUNT=`grep AndV test.out | wc -l | awk '{print $1}'` 109 if [ $COUNT -lt 3 ] 110 then 111 echo "Test Failed: AndV $COUNT < 3" 112 exit 1 113 fi 114 115 COUNT=`grep OrV test.out | wc -l | awk '{print $1}'` 116 if [ $COUNT -lt 3 ] 117 then 118 echo "Test Failed: OrV $COUNT < 3" 119 exit 1 120 fi 121 122 COUNT=`grep XorV test.out | wc -l | awk '{print $1}'` 123 if [ $COUNT -lt 3 ] 124 then 125 echo "Test Failed: XorV $COUNT < 3" 126 exit 1 127 fi 128 129 # LShiftVI+SubVI is generated for test_mulc 130 COUNT=`grep LShiftVI test.out | wc -l | awk '{print $1}'` 131 if [ $COUNT -lt 5 ] 132 then 133 echo "Test Failed: LShiftVI $COUNT < 5" 134 exit 1 135 fi 136 137 COUNT=`grep RShiftVI test.out | sed '/URShiftVI/d' | wc -l | awk '{print $1}'` 138 if [ $COUNT -lt 3 ] 139 then 140 echo "Test Failed: RShiftVI $COUNT < 3" 141 exit 1 142 fi 143 144 COUNT=`grep URShiftVI test.out | wc -l | awk '{print $1}'` 145 if [ $COUNT -lt 3 ] 146 then 147 echo "Test Failed: URShiftVI $COUNT < 3" 148 exit 1 149 fi 150