1 #!/bin/sh
2
3 #
4 # Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
5 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 #
7 # This code is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU General Public License version 2 only, as
9 # published by the Free Software Foundation.
10 #
11 # This code is distributed in the hope that it will be useful, but WITHOUT
12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 # version 2 for more details (a copy is included in the LICENSE file that
15 # accompanied this code).
16 #
17 # You should have received a copy of the GNU General Public License version
18 # 2 along with this work; if not, write to the Free Software Foundation,
19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 #
21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 # or visit www.oracle.com if you need additional information or have any
23 # questions.
24 #
25
26 ##
27 ## @test
28 ## @requires (os.arch =="x86_64" | os.arch == "amd64") & (vm.bits == "64")
29 ## @summary test JNI critical arrays support in Shenandoah
30 ## @run shell/timeout=480 CriticalNativeArgs.sh
31 ##
32
33 if [ "${TESTSRC}" = "" ]
34 then
35 TESTSRC=${PWD}
36 echo "TESTSRC not set. Using "${TESTSRC}" as default"
37 fi
38 echo "TESTSRC=${TESTSRC}"
39 ## Adding common setup Variables for running shell tests.
40 . ${TESTSRC}/../../test_env.sh
41
42 # set platform-dependent variables
43 if [ "$VM_OS" = "linux" ]; then
44 echo "Testing on linux"
45 gcc_cmd=`which gcc`
46 if [ "x$gcc_cmd" = "x" ]; then
47 echo "WARNING: gcc not found. Cannot execute test." 2>&1
48 exit 0;
49 fi
50 else
51 echo "Test passed; only valid for linux: $VM_OS"
52 exit 0;
53 fi
54
55 THIS_DIR=.
56
57 cp ${TESTSRC}${FS}*.java ${THIS_DIR}
58 ${TESTJAVA}${FS}bin${FS}javac CriticalNativeArgs.java
59
60 $gcc_cmd -O1 -DLINUX -fPIC -shared \
61 -o ${THIS_DIR}${FS}libCriticalNative.so \
62 -I${TESTJAVA}${FS}include \
63 -I${TESTJAVA}${FS}include${FS}linux \
64 ${TESTSRC}${FS}libCriticalNative.c
65
66 # run the java test in the background
67 cmd="${TESTJAVA}${FS}bin${FS}java -XX:+UseShenandoahGC -XX:+UnlockDiagnosticVMOptions -XX:ShenandoahGCHeuristics=passive -XX:-ShenandoahDegeneratedGC -Xcomp -Xmx512M -XX:+CriticalJNINatives \
68 -Djava.library.path=${THIS_DIR}${FS} CriticalNativeArgs"
69
70 echo "$cmd"
71 eval $cmd
72
73 if [ $? -ne 0 ]
74 then
75 echo "Test Failed"
76 exit 1
77 fi
78
79 cmd="${TESTJAVA}${FS}bin${FS}java -XX:+UseShenandoahGC -XX:+UnlockDiagnosticVMOptions -XX:ShenandoahGCHeuristics=passive -XX:+ShenandoahDegeneratedGC -Xcomp -Xmx512M -XX:+CriticalJNINatives \
80 -Djava.library.path=${THIS_DIR}${FS} CriticalNativeArgs"
81
82 echo "$cmd"
83 eval $cmd
84
85 if [ $? -ne 0 ]
86 then
87 echo "Test Failed"
88 exit 1
89 fi
90
91 cmd="${TESTJAVA}${FS}bin${FS}java -XX:+UseShenandoahGC -Xcomp -Xmx256M -XX:+CriticalJNINatives \
92 -Djava.library.path=${THIS_DIR}${FS} CriticalNativeArgs"
93
94 echo "$cmd"
95 eval $cmd
96
97 if [ $? -ne 0 ]
98 then
99 echo "Test Failed"
100 exit 1
101 fi
102
103 cmd="${TESTJAVA}${FS}bin${FS}java -XX:+UseShenandoahGC -XX:+UnlockDiagnosticVMOptions -XX:ShenandoahGCHeuristics=aggressive -Xcomp -Xmx512M -XX:+CriticalJNINatives \
104 -Djava.library.path=${THIS_DIR}${FS} CriticalNativeArgs"
105
106 echo "$cmd"
107 eval $cmd
108
109 if [ $? -ne 0 ]
110 then
111 echo "Test Failed"
112 exit 1
113 fi
114
|
1 #!/bin/sh
2
3 #
4 # Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
5 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 #
7 # This code is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU General Public License version 2 only, as
9 # published by the Free Software Foundation.
10 #
11 # This code is distributed in the hope that it will be useful, but WITHOUT
12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 # version 2 for more details (a copy is included in the LICENSE file that
15 # accompanied this code).
16 #
17 # You should have received a copy of the GNU General Public License version
18 # 2 along with this work; if not, write to the Free Software Foundation,
19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 #
21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 # or visit www.oracle.com if you need additional information or have any
23 # questions.
24 #
25
26 ##
27 ## @test
28 ## @requires (os.arch == "x86_64" | os.arch == "amd64")
29 ## @summary test JNI critical arrays support in Shenandoah
30 ## @run shell/timeout=480 TestCriticalNativeArgs.sh
31 ##
32
33 if [ "${TESTSRC}" = "" ]
34 then
35 TESTSRC=${PWD}
36 echo "TESTSRC not set. Using "${TESTSRC}" as default"
37 fi
38 echo "TESTSRC=${TESTSRC}"
39 ## Adding common setup Variables for running shell tests.
40 . ${TESTSRC}/../../../test_env.sh
41
42 # set platform-dependent variables
43 if [ "$VM_OS" = "linux" ]; then
44 echo "Testing on linux"
45 gcc_cmd=`which gcc`
46 if [ "x$gcc_cmd" = "x" ]; then
47 echo "WARNING: gcc not found. Cannot execute test." 2>&1
48 exit 0;
49 fi
50 else
51 echo "Test passed; only valid for linux: $VM_OS"
52 exit 0;
53 fi
54
55 THIS_DIR=.
56
57 cp ${TESTSRC}${FS}*.java ${THIS_DIR}
58 ${TESTJAVA}${FS}bin${FS}javac TestCriticalNativeArgs.java
59
60 $gcc_cmd -O1 -DLINUX -fPIC -shared \
61 -o ${THIS_DIR}${FS}libTestCriticalNative.so \
62 -I${TESTJAVA}${FS}include \
63 -I${TESTJAVA}${FS}include${FS}linux \
64 ${TESTSRC}${FS}libTestCriticalNative.c
65
66 # run the java test in the background
67 cmd="${TESTJAVA}${FS}bin${FS}java -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=passive -XX:-ShenandoahDegeneratedGC -Xcomp -Xmx512M -XX:+CriticalJNINatives \
68 -Djava.library.path=${THIS_DIR}${FS} TestCriticalNativeArgs"
69
70 echo "$cmd"
71 eval $cmd
72
73 if [ $? -ne 0 ]
74 then
75 echo "Test Failed"
76 exit 1
77 fi
78
79 cmd="${TESTJAVA}${FS}bin${FS}java -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=passive -XX:+ShenandoahDegeneratedGC -Xcomp -Xmx512M -XX:+CriticalJNINatives \
80 -Djava.library.path=${THIS_DIR}${FS} TestCriticalNativeArgs"
81
82 echo "$cmd"
83 eval $cmd
84
85 if [ $? -ne 0 ]
86 then
87 echo "Test Failed"
88 exit 1
89 fi
90
91 cmd="${TESTJAVA}${FS}bin${FS}java -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xcomp -Xmx256M -XX:+CriticalJNINatives \
92 -Djava.library.path=${THIS_DIR}${FS} TestCriticalNativeArgs"
93
94 echo "$cmd"
95 eval $cmd
96
97 if [ $? -ne 0 ]
98 then
99 echo "Test Failed"
100 exit 1
101 fi
102
103 cmd="${TESTJAVA}${FS}bin${FS}java -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive -Xcomp -Xmx512M -XX:+CriticalJNINatives \
104 -Djava.library.path=${THIS_DIR}${FS} TestCriticalNativeArgs"
105
106 echo "$cmd"
107 eval $cmd
108
109 if [ $? -ne 0 ]
110 then
111 echo "Test Failed"
112 exit 1
113 fi
|