From 9045aca85bf17b5a49c01e419a03b84704316fbe Mon Sep 17 00:00:00 2001 From: Nikodemus Siivola Date: Fri, 9 Dec 2011 14:53:54 +0200 Subject: [PATCH] test for bug 308941 Has fixed itself at some point, let's keep it from regressing. --- tests/compiler-test-util.lisp | 17 +++++++++++++++++ tests/compiler.impure.lisp | 12 ++++++++++++ 2 files changed, 29 insertions(+) diff --git a/tests/compiler-test-util.lisp b/tests/compiler-test-util.lisp index 938af5c..6a7bca3 100644 --- a/tests/compiler-test-util.lisp +++ b/tests/compiler-test-util.lisp @@ -108,3 +108,20 @@ (values warn fail))) (ignore-errors (delete-file lisp)) (ignore-errors (delete-file fasl))))) + +(defun file-compile (toplevel-forms &key load) + (let* ((lisp (merge-pathnames "file-compile-tmp.lisp")) + (fasl (compile-file-pathname lisp))) + (unwind-protect + (progn + (with-open-file (f lisp :direction :output) + (if (stringp toplevel-forms) + (write-line toplevel-forms f) + (dolist (form toplevel-forms) + (prin1 form f)))) + (multiple-value-bind (fasl warn fail) (compile-file lisp) + (when load + (load fasl)) + (values warn fail))) + (ignore-errors (delete-file lisp)) + (ignore-errors (delete-file fasl))))) diff --git a/tests/compiler.impure.lisp b/tests/compiler.impure.lisp index 230c2d0..d437d1c 100644 --- a/tests/compiler.impure.lisp +++ b/tests/compiler.impure.lisp @@ -2234,4 +2234,16 @@ (cdr (assoc symbol exported-symbols-alist))))) :load nil))) +(test-util:with-test (:name :bug-308941) + (multiple-value-bind (warn fail) + (let ((*check-consistency* t)) + (ctu:file-compile + "(eval-when (:compile-toplevel :load-toplevel :execute) + (defstruct foo3)) + (defstruct bar + (foo #.(make-foo3)))" + :load nil)) + ;; ...but the compiler should not break. + (assert (and warn fail)))) + ;;; success -- 1.7.10.4