Mercurial > hg > graal-compiler
annotate test/runtime/jsig/Test8017498.sh @ 14482:5e7eb4244604
8025519: [TESTBUG] runtime/7107135/Test7107135.sh need to use COMPILEJAVA for javac task
Summary: modified some tests to use COMPILEJAVA instead of TESTJAVA for javac and include path
Reviewed-by: dholmes, mseledtsov
author | ccheung |
---|---|
date | Mon, 24 Feb 2014 21:54:22 -0800 |
parents | d85f79f0c476 |
children | 4ca6dc0799b6 |
rev | line source |
---|---|
11147
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
1 #!/bin/sh |
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
2 |
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
3 # |
14244
d85f79f0c476
8022301: [TESTBUG] runtime/jsig/Test8017498.sh incorrectly compiles native code
ccheung
parents:
13402
diff
changeset
|
4 # Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. |
11147
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
5 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
6 # |
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
7 # This code is free software; you can redistribute it and/or modify it |
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
8 # under the terms of the GNU General Public License version 2 only, as |
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
9 # published by the Free Software Foundation. |
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
10 # |
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
11 # This code is distributed in the hope that it will be useful, but WITHOUT |
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
14 # version 2 for more details (a copy is included in the LICENSE file that |
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
15 # accompanied this code). |
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
16 # |
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
17 # You should have received a copy of the GNU General Public License version |
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
18 # 2 along with this work; if not, write to the Free Software Foundation, |
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
20 # |
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
22 # or visit www.oracle.com if you need additional information or have any |
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
23 # questions. |
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
24 # |
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
25 |
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
26 ## |
13402
e567d5afd4dd
8028160: [TESTBUG] Exclude failing (runtime) jtreg tests using @ignore
hseigel
parents:
11967
diff
changeset
|
27 ## @ignore 8028806 |
11147
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
28 ## @test Test8017498.sh |
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
29 ## @bug 8017498 |
11160
72727c4b6dec
8020791: [TESTBUG] runtime/jsig/Test8017498.sh failed to compile native code
ccheung
parents:
11147
diff
changeset
|
30 ## @bug 8020791 |
11967
f9ee986a9fea
8021296: [TESTBUG] Test8017498.sh fails to find "gcc" and fails to compile on some Linux releases
ccheung
parents:
11160
diff
changeset
|
31 ## @bug 8021296 |
14244
d85f79f0c476
8022301: [TESTBUG] runtime/jsig/Test8017498.sh incorrectly compiles native code
ccheung
parents:
13402
diff
changeset
|
32 ## @bug 8022301 |
14482
5e7eb4244604
8025519: [TESTBUG] runtime/7107135/Test7107135.sh need to use COMPILEJAVA for javac task
ccheung
parents:
14244
diff
changeset
|
33 ## @bug 8025519 |
11147
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
34 ## @summary sigaction(sig) results in process hang/timed-out if sig is much greater than SIGRTMAX |
14482
5e7eb4244604
8025519: [TESTBUG] runtime/7107135/Test7107135.sh need to use COMPILEJAVA for javac task
ccheung
parents:
14244
diff
changeset
|
35 ## @run shell/timeout=60 Test8017498.sh |
11147
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
36 ## |
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
37 |
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
38 if [ "${TESTSRC}" = "" ] |
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
39 then |
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
40 TESTSRC=${PWD} |
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
41 echo "TESTSRC not set. Using "${TESTSRC}" as default" |
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
42 fi |
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
43 echo "TESTSRC=${TESTSRC}" |
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
44 ## Adding common setup Variables for running shell tests. |
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
45 . ${TESTSRC}/../../test_env.sh |
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
46 |
14244
d85f79f0c476
8022301: [TESTBUG] runtime/jsig/Test8017498.sh incorrectly compiles native code
ccheung
parents:
13402
diff
changeset
|
47 EXTRA_CFLAG= |
d85f79f0c476
8022301: [TESTBUG] runtime/jsig/Test8017498.sh incorrectly compiles native code
ccheung
parents:
13402
diff
changeset
|
48 |
11147
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
49 # set platform-dependent variables |
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
50 OS=`uname -s` |
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
51 case "$OS" in |
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
52 Linux) |
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
53 echo "Testing on Linux" |
11967
f9ee986a9fea
8021296: [TESTBUG] Test8017498.sh fails to find "gcc" and fails to compile on some Linux releases
ccheung
parents:
11160
diff
changeset
|
54 gcc_cmd=`which gcc` |
f9ee986a9fea
8021296: [TESTBUG] Test8017498.sh fails to find "gcc" and fails to compile on some Linux releases
ccheung
parents:
11160
diff
changeset
|
55 if [ "x$gcc_cmd" == "x" ]; then |
f9ee986a9fea
8021296: [TESTBUG] Test8017498.sh fails to find "gcc" and fails to compile on some Linux releases
ccheung
parents:
11160
diff
changeset
|
56 echo "WARNING: gcc not found. Cannot execute test." 2>&1 |
f9ee986a9fea
8021296: [TESTBUG] Test8017498.sh fails to find "gcc" and fails to compile on some Linux releases
ccheung
parents:
11160
diff
changeset
|
57 exit 0; |
f9ee986a9fea
8021296: [TESTBUG] Test8017498.sh fails to find "gcc" and fails to compile on some Linux releases
ccheung
parents:
11160
diff
changeset
|
58 fi |
14482
5e7eb4244604
8025519: [TESTBUG] runtime/7107135/Test7107135.sh need to use COMPILEJAVA for javac task
ccheung
parents:
14244
diff
changeset
|
59 MY_LD_PRELOAD=${TESTJAVA}${FS}jre${FS}lib${FS}${VM_CPU}${FS}libjsig.so |
5e7eb4244604
8025519: [TESTBUG] runtime/7107135/Test7107135.sh need to use COMPILEJAVA for javac task
ccheung
parents:
14244
diff
changeset
|
60 if [ "$VM_BITS" == "32" ] && [ "$VM_CPU" != "arm" ] && [ "$VM_CPU" != "ppc" ]; then |
5e7eb4244604
8025519: [TESTBUG] runtime/7107135/Test7107135.sh need to use COMPILEJAVA for javac task
ccheung
parents:
14244
diff
changeset
|
61 EXTRA_CFLAG=-m32 |
11147
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
62 fi |
11160
72727c4b6dec
8020791: [TESTBUG] runtime/jsig/Test8017498.sh failed to compile native code
ccheung
parents:
11147
diff
changeset
|
63 echo MY_LD_PRELOAD = ${MY_LD_PRELOAD} |
11147
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
64 ;; |
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
65 *) |
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
66 echo "Test passed; only valid for Linux" |
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
67 exit 0; |
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
68 ;; |
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
69 esac |
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
70 |
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
71 THIS_DIR=. |
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
72 |
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
73 cp ${TESTSRC}${FS}*.java ${THIS_DIR} |
14482
5e7eb4244604
8025519: [TESTBUG] runtime/7107135/Test7107135.sh need to use COMPILEJAVA for javac task
ccheung
parents:
14244
diff
changeset
|
74 ${COMPILEJAVA}${FS}bin${FS}javac *.java |
11147
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
75 |
11967
f9ee986a9fea
8021296: [TESTBUG] Test8017498.sh fails to find "gcc" and fails to compile on some Linux releases
ccheung
parents:
11160
diff
changeset
|
76 $gcc_cmd -DLINUX -fPIC -shared \ |
14244
d85f79f0c476
8022301: [TESTBUG] runtime/jsig/Test8017498.sh incorrectly compiles native code
ccheung
parents:
13402
diff
changeset
|
77 ${EXTRA_CFLAG} -z noexecstack \ |
11160
72727c4b6dec
8020791: [TESTBUG] runtime/jsig/Test8017498.sh failed to compile native code
ccheung
parents:
11147
diff
changeset
|
78 -o ${TESTSRC}${FS}libTestJNI.so \ |
14482
5e7eb4244604
8025519: [TESTBUG] runtime/7107135/Test7107135.sh need to use COMPILEJAVA for javac task
ccheung
parents:
14244
diff
changeset
|
79 -I${COMPILEJAVA}${FS}include \ |
5e7eb4244604
8025519: [TESTBUG] runtime/7107135/Test7107135.sh need to use COMPILEJAVA for javac task
ccheung
parents:
14244
diff
changeset
|
80 -I${COMPILEJAVA}${FS}include${FS}linux \ |
11160
72727c4b6dec
8020791: [TESTBUG] runtime/jsig/Test8017498.sh failed to compile native code
ccheung
parents:
11147
diff
changeset
|
81 ${TESTSRC}${FS}TestJNI.c |
11147
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
82 |
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
83 # run the java test in the background |
11160
72727c4b6dec
8020791: [TESTBUG] runtime/jsig/Test8017498.sh failed to compile native code
ccheung
parents:
11147
diff
changeset
|
84 cmd="LD_PRELOAD=$MY_LD_PRELOAD \ |
72727c4b6dec
8020791: [TESTBUG] runtime/jsig/Test8017498.sh failed to compile native code
ccheung
parents:
11147
diff
changeset
|
85 ${TESTJAVA}${FS}bin${FS}java \ |
72727c4b6dec
8020791: [TESTBUG] runtime/jsig/Test8017498.sh failed to compile native code
ccheung
parents:
11147
diff
changeset
|
86 -Djava.library.path=${TESTSRC}${FS} -server TestJNI 100" |
72727c4b6dec
8020791: [TESTBUG] runtime/jsig/Test8017498.sh failed to compile native code
ccheung
parents:
11147
diff
changeset
|
87 echo "$cmd > test.out 2>&1" |
72727c4b6dec
8020791: [TESTBUG] runtime/jsig/Test8017498.sh failed to compile native code
ccheung
parents:
11147
diff
changeset
|
88 eval $cmd > test.out 2>&1 |
11147
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
89 |
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
90 grep "old handler" test.out > ${NULL} |
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
91 if [ $? = 0 ] |
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
92 then |
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
93 echo "Test Passed" |
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
94 exit 0 |
732af649bc3a
8017498: JVM crashes when native code calls sigaction(sig) where sig>=0x20
ccheung
parents:
diff
changeset
|
95 fi |
11160
72727c4b6dec
8020791: [TESTBUG] runtime/jsig/Test8017498.sh failed to compile native code
ccheung
parents:
11147
diff
changeset
|
96 |
72727c4b6dec
8020791: [TESTBUG] runtime/jsig/Test8017498.sh failed to compile native code
ccheung
parents:
11147
diff
changeset
|
97 echo "Test Failed" |
72727c4b6dec
8020791: [TESTBUG] runtime/jsig/Test8017498.sh failed to compile native code
ccheung
parents:
11147
diff
changeset
|
98 exit 1 |