X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fforeign-stack-alignment.impure.lisp;h=c7b2b909f0ef6297ce92dfc25b8128d535f8f048;hb=885a956ae2044a0c5c4a2b55db8e32b7f6b48d05;hp=069c5e8172141ba53aaebbe4be54ad9891253ae1;hpb=01b41fdd69d197da85f86a2e4f8971f3ef9dda82;p=sbcl.git diff --git a/tests/foreign-stack-alignment.impure.lisp b/tests/foreign-stack-alignment.impure.lisp index 069c5e8..c7b2b90 100644 --- a/tests/foreign-stack-alignment.impure.lisp +++ b/tests/foreign-stack-alignment.impure.lisp @@ -22,7 +22,6 @@ (output (with-output-to-string (s) (setf proc (run-program program arguments - :environment (test-util::test-env) :output s))))) (unless (zerop (process-exit-code proc)) (error "Bad exit code: ~S~%Output:~% ~S" @@ -43,34 +42,37 @@ ;;;; fork/exec, so that no lisp is on the stack. This is our known-good ;;;; number. -(run "/bin/sh" "run-compiler.sh" "-sbcl-pic" - "stack-alignment-offset.c" "-o" "stack-alignment-offset") +#-win32 +(progn + (run "/bin/sh" "run-compiler.sh" "-sbcl-pic" + "stack-alignment-offset.c" "-o" "stack-alignment-offset") -(defparameter *good-offset* - (parse-integer (run "./stack-alignment-offset" - (princ-to-string *required-alignment*)))) + (defparameter *good-offset* + (parse-integer (run "./stack-alignment-offset" + (princ-to-string *required-alignment*)))) -;;;; Build the tool again, this time as a shared object, and load it + ;; Build the tool again, this time as a shared object, and load it -(run "/bin/sh" "run-compiler.sh" "-sbcl-pic" "-sbcl-shared" - "stack-alignment-offset.c" "-o" "stack-alignment-offset.so") + (run "/bin/sh" "run-compiler.sh" "-sbcl-pic" "-sbcl-shared" + "stack-alignment-offset.c" "-o" "stack-alignment-offset.so") -(load-shared-object (truename "stack-alignment-offset.so")) + (load-shared-object (truename "stack-alignment-offset.so")) -(define-alien-routine stack-alignment-offset int (alignment int)) -(define-alien-routine trampoline int (callback (function int))) + (define-alien-routine stack-alignment-offset int (alignment int)) + (define-alien-routine trampoline int (callback (function int)))) ;;;; Now get the offset by calling from lisp, first with a regular foreign function ;;;; call, then with an intervening callback. -(with-test (:name :regular) +(with-test (:name :regular :fails-on :win32) (assert (= *good-offset* (stack-alignment-offset *required-alignment*)))) -(with-test (:name :callback) +(with-test (:name :callback :fails-on :win32) (assert (= *good-offset* (trampoline (alien-lambda int () (stack-alignment-offset *required-alignment*)))))) -(delete-file "stack-alignment-offset") -(delete-file "stack-alignment-offset.so") +(when (probe-file "stack-alignment-offset.so") + (delete-file "stack-alignment-offset") + (delete-file "stack-alignment-offset.so")) ;;;; success!