X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Falien.impure.lisp;h=aa14cf265b54e513175dae3e684a1886b7be69a3;hb=05854d6d554238cf3cfbe2b68e7ae8060f71b536;hp=74da45aa0bb104acf31166fd99a90fbb8a30706e;hpb=dc3864367e0ae2964e6e346ff5c4ecfea9ddc0f0;p=sbcl.git diff --git a/tests/alien.impure.lisp b/tests/alien.impure.lisp index 74da45a..aa14cf2 100644 --- a/tests/alien.impure.lisp +++ b/tests/alien.impure.lisp @@ -226,4 +226,30 @@ (loop repeat 1024 do (try-to-leak-alien-stack t)))) +;;; bug 431 +(with-test (:name :alien-struct-redefinition) + (eval '(progn + (define-alien-type nil (struct mystruct (myshort short) (mychar char))) + (with-alien ((myst (struct mystruct))) + (with-alien ((mysh short (slot myst 'myshort))) + (assert (integerp mysh)))))) + (let ((restarted 0)) + (handler-bind ((error (lambda (e) + (let ((cont (find-restart 'continue e))) + (when cont + (incf restarted) + (invoke-restart cont)))))) + (eval '(define-alien-type nil (struct mystruct (myint int) (mychar char))))) + (assert (= 1 restarted))) + (eval '(with-alien ((myst (struct mystruct))) + (with-alien ((myin int (slot myst 'myint))) + (assert (integerp myin)))))) + +;;; void conflicted with derived type +(declaim (inline bug-316075)) +(sb-alien:define-alien-routine bug-316075 void (result char :out)) +(with-test (:name bug-316075) + (handler-bind ((warning #'error)) + (compile nil '(lambda () (multiple-value-list (bug-316075)))))) + ;;; success