message
[sbcl.git] / tests / compiler.impure-cload.lisp
index 2967dfc..9a2d2f6 100644 (file)
              (DECLARE (IGNORE OTHER-1))))
     (continuation-1)))
 
+;;; reported by antifuchs/bdowning/etc on #lisp: ITERATE failure on
+;;; (iter (for i in '(1 2 3)) (+ i 50))
+(defun values-producer () (values 1 2 3 4 5 6 7))
+
+(defun values-consumer (fn)
+  (let (a b c d e f g h)
+    (multiple-value-bind (aa bb cc dd ee ff gg hh) (funcall fn)
+      (setq a aa)
+      (setq b bb)
+      (setq c cc)
+      (setq d dd)
+      (setq e ee)
+      (setq f ff)
+      (setq g gg)
+      (setq h hh)
+      (values a b c d e f g h))))
+
+(let ((list (multiple-value-list (values-consumer #'values-producer))))
+  (assert (= (length list) 8))
+  (assert (null (nth 7 list))))
+
+;;; failed on Alpha prior to sbcl-0.8.10.30
+(defun lotso-values ()
+  (values 0 1 2 3 4 5 6 7 8 9
+         0 1 2 3 4 5 6 7 8 9
+         0 1 2 3 4 5 6 7 8 9
+         0 1 2 3 4 5 6 7 8 9
+         0 1 2 3 4 5 6 7 8 9
+         0 1 2 3 4 5 6 7 8 9
+         0 1 2 3 4 5 6 7 8 9
+         0 1 2 3 4 5 6 7 8 9
+         0 1 2 3 4 5 6 7 8 9
+         0 1 2 3 4 5 6 7 8 9))
+
+;;; bug 313: source transforms were "lisp-1"
+(defun srctran-lisp1-1 (cadr) (if (functionp cadr) (funcall cadr 1) nil))
+(assert (eql (funcall (eval #'srctran-lisp1-1) #'identity) 1))
+(without-package-locks 
+   ;; this be a nasal demon, but test anyways
+   (defvar caar))
+(defun srctran-lisp1-2 (caar) (funcall (sb-ext:truly-the function caar) 1))
+(assert (eql (funcall (eval #'srctran-lisp1-2) #'identity) 1))
+
+;;; partial bug 262: reference of deleted CTRAN (in RETURN-FROM)
+;;; during inline expansion. Bug report by Peter Denno, simplified
+;;; test case by David Wragg.
+(defun bug262-return-from (x &aux (y nil))
+  (labels ((foo-a (z) (return-from bug262-return-from z))
+           (foo-b (z) (foo-a z)))
+    (declare (inline foo-a))
+    (foo-a x)))
 \f
 (sb-ext:quit :unix-status 104)