# absolutely no warranty. See the COPYING and CREDITS files for
# more information.
+. ./expect.sh
. ./subr.sh
+
use_test_subdirectory
echo //entering foreign.test.sh
CFLAGS="$CFLAGS -fPIC"
;;
esac
- if [ "`uname`" = Darwin ]; then
- SO_FLAGS="-bundle"
- if run_sbcl --eval '(sb-ext:quit :unix-status #+x86-64 0 #-x86-64 1)'; then
- CFLAGS="$CFLAGS -arch x86_64"
- fi
- else
- SO_FLAGS="-shared"
- fi
+ case "`uname`" in
+ Darwin)
+ SO_FLAGS="-bundle"
+ if run_sbcl --eval '(sb-ext:quit :unix-status #+x86-64 0 #-x86-64 1)'; then
+ CFLAGS="$CFLAGS -arch x86_64"
+ fi
+ ;;
+ OpenBSD)
+ SO_FLAGS="-shared"
+ if [ "`machine -a`" = "powerpc" ]; then
+ CFLAGS="$CFLAGS -fPIC"
+ fi
+ ;;
+ *)
+ SO_FLAGS="-shared"
+ ;;
+ esac
cc -c $1.c -o $1.o $CFLAGS
ld $SO_FLAGS -o $1.so $1.o
)
EOF
check_status_maybe_lose "struct offsets" $?
+cat > $TEST_FILESTEM.alien.enum.lisp <<EOF
+(define-alien-type foo-flag
+ (enum foo-flag-
+ (:a 1)
+ (:b 2)))
+
+(define-alien-type bar
+ (struct bar
+ (foo-flag foo-flag)))
+
+(define-alien-type barp
+ (* bar))
+
+(defun foo (x)
+ (declare (type (alien barp) x))
+ x)
+
+(defun bar (x)
+ (declare (type (alien barp) x))
+ x)
+EOF
+expect_clean_compile $TEST_FILESTEM.alien.enum.lisp
+
# success convention for script
exit $EXIT_TEST_WIN