6803
|
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
|
6823
|
80 # grep for support integer multiply vectors (cpu with SSE4.1)
|
|
81 ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -XX:+PrintMiscellaneous -XX:+Verbose -version | grep "cores per cpu" | grep "sse4.1"
|
|
82
|
|
83 if [ $? != 0 ]
|
|
84 then
|
|
85 SSE=2
|
|
86 else
|
|
87 SSE=4
|
|
88 fi
|
|
89
|
6803
|
90 cp ${TESTSRC}${FS}TestIntVect.java .
|
|
91 ${TESTJAVA}${FS}bin${FS}javac -d . TestIntVect.java
|
|
92
|
|
93 ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -Xbatch -XX:-TieredCompilation -XX:CICompilerCount=1 -XX:+PrintCompilation -XX:+TraceNewVectors TestIntVect > test.out 2>&1
|
|
94
|
|
95 COUNT=`grep AddVI test.out | wc -l | awk '{print $1}'`
|
|
96 if [ $COUNT -lt 4 ]
|
|
97 then
|
|
98 echo "Test Failed: AddVI $COUNT < 4"
|
|
99 exit 1
|
|
100 fi
|
|
101
|
|
102 # AddVI is generated for test_subc
|
|
103 COUNT=`grep SubVI test.out | wc -l | awk '{print $1}'`
|
|
104 if [ $COUNT -lt 4 ]
|
|
105 then
|
|
106 echo "Test Failed: SubVI $COUNT < 4"
|
|
107 exit 1
|
|
108 fi
|
|
109
|
6823
|
110 # MulVI is only supported with SSE4.1.
|
|
111 if [ $SSE -gt 3 ]
|
|
112 then
|
6803
|
113 # LShiftVI+SubVI is generated for test_mulc
|
|
114 COUNT=`grep MulVI test.out | wc -l | awk '{print $1}'`
|
|
115 if [ $COUNT -lt 2 ]
|
|
116 then
|
|
117 echo "Test Failed: MulVI $COUNT < 2"
|
|
118 exit 1
|
|
119 fi
|
6823
|
120 fi
|
6803
|
121
|
|
122 COUNT=`grep AndV test.out | wc -l | awk '{print $1}'`
|
|
123 if [ $COUNT -lt 3 ]
|
|
124 then
|
|
125 echo "Test Failed: AndV $COUNT < 3"
|
|
126 exit 1
|
|
127 fi
|
|
128
|
|
129 COUNT=`grep OrV test.out | wc -l | awk '{print $1}'`
|
|
130 if [ $COUNT -lt 3 ]
|
|
131 then
|
|
132 echo "Test Failed: OrV $COUNT < 3"
|
|
133 exit 1
|
|
134 fi
|
|
135
|
|
136 COUNT=`grep XorV test.out | wc -l | awk '{print $1}'`
|
|
137 if [ $COUNT -lt 3 ]
|
|
138 then
|
|
139 echo "Test Failed: XorV $COUNT < 3"
|
|
140 exit 1
|
|
141 fi
|
|
142
|
6823
|
143 # LShiftVI+SubVI is generated for test_mulc
|
6803
|
144 COUNT=`grep LShiftVI test.out | wc -l | awk '{print $1}'`
|
|
145 if [ $COUNT -lt 5 ]
|
|
146 then
|
|
147 echo "Test Failed: LShiftVI $COUNT < 5"
|
|
148 exit 1
|
|
149 fi
|
|
150
|
6823
|
151 COUNT=`grep RShiftVI test.out | sed '/URShiftVI/d' | wc -l | awk '{print $1}'`
|
|
152 if [ $COUNT -lt 3 ]
|
6803
|
153 then
|
6823
|
154 echo "Test Failed: RShiftVI $COUNT < 3"
|
6803
|
155 exit 1
|
|
156 fi
|
|
157
|
|
158 COUNT=`grep URShiftVI test.out | wc -l | awk '{print $1}'`
|
|
159 if [ $COUNT -lt 3 ]
|
|
160 then
|
|
161 echo "Test Failed: URShiftVI $COUNT < 3"
|
|
162 exit 1
|
|
163 fi
|
|
164
|