Mercurial > hg > truffle
comparison test/runtime/6929067/Test6929067.sh @ 6869:e0ea0e94c23c
7195151: Multiplatform tescase for 6929067
Reviewed-by: kamg, kvn
author | kevinw |
---|---|
date | Mon, 15 Oct 2012 16:48:48 +0100 |
parents | 6acee021f5ac |
children | 04d6d4322c6a |
comparison
equal
deleted
inserted
replaced
6868:48a75d2640a5 | 6869:e0ea0e94c23c |
---|---|
2 | 2 |
3 ## | 3 ## |
4 ## @test Test6929067.sh | 4 ## @test Test6929067.sh |
5 ## @bug 6929067 | 5 ## @bug 6929067 |
6 ## @summary Stack guard pages should be removed when thread is detached | 6 ## @summary Stack guard pages should be removed when thread is detached |
7 ## @compile T.java | |
7 ## @run shell Test6929067.sh | 8 ## @run shell Test6929067.sh |
8 ## | 9 ## |
9 | 10 |
10 if [ "${TESTSRC}" = "" ] | 11 if [ "${TESTSRC}" = "" ] |
11 then TESTSRC=. | 12 then TESTSRC=. |
31 echo "Test passed; only valid for Linux" | 32 echo "Test passed; only valid for Linux" |
32 exit 0; | 33 exit 0; |
33 ;; | 34 ;; |
34 esac | 35 esac |
35 | 36 |
36 # Choose arch: i386 or amd64 (test is Linux-specific) | 37 ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -Xinternalversion > vm_version.out 2>&1 |
38 | |
39 # Bitness: | |
37 # Cannot simply look at TESTVMOPTS as -d64 is not | 40 # Cannot simply look at TESTVMOPTS as -d64 is not |
38 # passed if there is only a 64-bit JVM available. | 41 # passed if there is only a 64-bit JVM available. |
39 | 42 |
40 ${TESTJAVA}/bin/java ${TESTVMOPTS} -version 2>1 | grep "64-Bit" >/dev/null | 43 grep "64-Bit" vm_version.out > ${NULL} |
41 if [ "$?" = "0" ] | 44 if [ "$?" = "0" ] |
42 then | 45 then |
43 ARCH=amd64 | 46 COMP_FLAG="-m64" |
44 else | 47 else |
45 ARCH=i386 | 48 COMP_FLAG="-m32" |
46 fi | 49 fi |
47 | 50 |
48 LD_LIBRARY_PATH=.:${TESTJAVA}/jre/lib/${ARCH}/client:/usr/openwin/lib:/usr/dt/lib:/usr/lib:$LD_LIBRARY_PATH | 51 |
52 # Architecture: | |
53 # Translate uname output to JVM directory name, but permit testing | |
54 # 32-bit x86 on an x64 platform. | |
55 ARCH=`uname -m` | |
56 case "$ARCH" in | |
57 x86_64) | |
58 if [ "$COMP_FLAG" = "-m32" ]; then | |
59 ARCH=i386 | |
60 else | |
61 ARCH=amd64 | |
62 fi | |
63 ;; | |
64 ppc64) | |
65 if [ "$COMP_FLAG" = "-m32" ]; then | |
66 ARCH=ppc | |
67 else | |
68 ARCH=ppc64 | |
69 fi | |
70 ;; | |
71 sparc64) | |
72 if [ "$COMP_FLAG" = "-m32" ]; then | |
73 ARCH=sparc | |
74 else | |
75 ARCH=sparc64 | |
76 fi | |
77 ;; | |
78 arm*) | |
79 # 32-bit ARM machine: compiler may not recognise -m32 | |
80 COMP_FLAG="" | |
81 ARCH=arm | |
82 ;; | |
83 aarch64) | |
84 # 64-bit arm machine, could be testing 32 or 64-bit: | |
85 if [ "$COMP_FLAG" = "-m32" ]; then | |
86 ARCH=arm | |
87 else | |
88 ARCH=aarch64 | |
89 fi | |
90 ;; | |
91 i586) | |
92 ARCH=i386 | |
93 ;; | |
94 i686) | |
95 ARCH=i386 | |
96 ;; | |
97 # Assuming other ARCH values need no translation | |
98 esac | |
99 | |
100 | |
101 # VM type: need to know server or client | |
102 VMTYPE=client | |
103 grep Server vm_version.out > ${NULL} | |
104 if [ "$?" = "0" ] | |
105 then | |
106 VMTYPE=server | |
107 fi | |
108 | |
109 | |
110 LD_LIBRARY_PATH=.:${TESTJAVA}/jre/lib/${ARCH}/${VMTYPE}:/usr/lib:$LD_LIBRARY_PATH | |
49 export LD_LIBRARY_PATH | 111 export LD_LIBRARY_PATH |
50 | 112 |
51 THIS_DIR=`pwd` | 113 cp ${TESTSRC}${FS}invoke.c . |
52 | 114 |
53 cp ${TESTSRC}${FS}invoke.c ${THIS_DIR} | 115 # Copy the result of our @compile action: |
54 cp ${TESTSRC}${FS}T.java ${THIS_DIR} | 116 cp ${TESTCLASSES}${FS}T.class . |
55 | |
56 | 117 |
57 ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -fullversion | 118 ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -fullversion |
58 | 119 |
59 ${TESTJAVA}${FS}bin${FS}javac T.java | 120 echo "Architecture: ${ARCH}" |
121 echo "Compilation flag: ${COMP_FLAG}" | |
122 echo "VM type: ${VMTYPE}" | |
60 | 123 |
61 gcc -o invoke -I${TESTJAVA}/include -I${TESTJAVA}/include/linux invoke.c ${TESTJAVA}/jre/lib/${ARCH}/client/libjvm.so | 124 gcc -DLINUX ${COMP_FLAG} -o invoke \ |
125 -I${TESTJAVA}/include -I${TESTJAVA}/include/linux \ | |
126 -L${TESTJAVA}/jre/lib/${ARCH}/${VMTYPE} \ | |
127 -ljvm -lpthread invoke.c | |
128 | |
62 ./invoke | 129 ./invoke |
63 exit $? | 130 exit $? |