0.7.8.16:
[sbcl.git] / tests / compiler.impure.lisp
index d9ea3fb..a9dd138 100644 (file)
@@ -420,6 +420,47 @@ BUG 48c, not yet fixed:
     (ignore-errors (bug110 0))
   (declare (ignore result))
   (assert (typep condition 'type-error)))
+
+;;; bug 202: the compiler failed to compile a function, which derived
+;;; type contradicted declared.
+(declaim (ftype (function () null) bug202))
+(defun bug202 ()
+  t)
+
+;;; bugs 178, 199: compiler failed to compile a call of a function
+;;; with a hairy type
+(defun bug178 (x)
+      (funcall (the function (the standard-object x))))
+
+(defun bug199-aux (f)
+  (eq nil (funcall f)))
+
+(defun bug199 (f x)
+  (declare (type (and function (satisfies bug199-aux)) f))
+  (funcall f x))
+
+;;; check non-toplevel DEFMACRO
+(defvar *defmacro-test-status* nil)
+
+(defun defmacro-test ()
+  (fmakunbound 'defmacro-test-aux)
+  (let* ((src "defmacro-test.lisp")
+         (obj (compile-file-pathname src)))
+    (unwind-protect
+         (progn
+           (compile-file src)
+           (assert (equal *defmacro-test-status* '(function a)))
+           (setq *defmacro-test-status* nil)
+           (load obj)
+           (assert (equal *defmacro-test-status* nil))
+           (macroexpand '(defmacro-test-aux 'a))
+           (assert (equal *defmacro-test-status* '(macro 'a z-value)))
+           (eval '(defmacro-test-aux 'a))
+           (assert (equal *defmacro-test-status* '(expanded 'a z-value))))
+      (ignore-errors (delete-file obj)))))
+
+(defmacro-test)
+
 \f
 ;;;; tests not in the problem domain, but of the consistency of the
 ;;;; compiler machinery itself