X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fforeign.test.sh;h=59e28cde20304f01647ccc2b1e48981f30991e1d;hb=e829d0de78c10d779de6bc5ace2ab3354e6236ec;hp=bd91bfe5dd3db4d8214a628adec40ab05061aa24;hpb=c3334d2307b721cfcea29e6abcd33e48487fb1ea;p=sbcl.git diff --git a/tests/foreign.test.sh b/tests/foreign.test.sh index bd91bfe..59e28cd 100644 --- a/tests/foreign.test.sh +++ b/tests/foreign.test.sh @@ -9,7 +9,7 @@ # While most of SBCL is derived from the CMU CL system, the test # files (like this one) were written from scratch after the fork # from CMU CL. -# +# # This software is in the public domain and is provided with # absolutely no warranty. See the COPYING and CREDITS files for # more information. @@ -23,20 +23,78 @@ PUNT=104 testfilestem=${TMPDIR:-/tmp}/sbcl-foreign-test-$$ -## Make a little shared object files to test with. +## Make some shared object files to test with. build_so() { echo building $1.so - if [ $(uname -p) = x86_64 ]; then + if [ "`uname -m`" = x86_64 ]; then CFLAGS="$CFLAGS -fPIC" fi + if [ "`uname`" = Darwin ]; then + SO_FLAGS="-bundle" + else + SO_FLAGS="-shared" + fi cc -c $1.c -o $1.o $CFLAGS - ld -shared -o $1.so $1.o + ld $SO_FLAGS -o $1.so $1.o +} + +cat > $testfilestem.c < $testfilestem.c -echo 'int numberish = 42;' >> $testfilestem.c -echo 'int nummish(int x) { return numberish + x; }' >> $testfilestem.c + +int long_test9(int a1, int a2, int a3, int a4, int a5, + int a6, int a7, long long l1, int a8) { + return (l1 == powish(2,35)); +} + +int long_test2(int i1, int i2, int i3, int i4, int i5, int i6, + int i7, int i8, int i9, long long l1, long long l2) { + return (l1 == (1 + powish(2,37))); +} + +long long return_long_long() { + return powish(2,33); +} +EOF + build_so $testfilestem echo 'int foo = 13;' > $testfilestem-b.c @@ -53,7 +111,7 @@ build_so $testfilestem-c ## Foreign definitions & load -cat > $testfilestem.def.lisp < $testfilestem.base.lisp < $testfilestem.def.lisp < $testfilestem.fast.lisp +cat $testfilestem.base.lisp >> $testfilestem.fast.lisp + +echo "(declaim (optimize space))" > $testfilestem.small.lisp +cat $testfilestem.base.lisp >> $testfilestem.small.lisp + # Test code cat > $testfilestem.test.lisp < $testfilestem.test.lisp <