X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fcompiler.pure.lisp;h=fb5d3e4b44c0924f9db0f7014f889b22c4bc0eb3;hb=a1007bcf38130a9a08e32f04a69e6836f76329d2;hp=0d4c2712194cde8fe18617d99c3071461be74259;hpb=b5183a46f304490682ebbac0a1a116681d3b2163;p=sbcl.git diff --git a/tests/compiler.pure.lisp b/tests/compiler.pure.lisp index 0d4c271..fb5d3e4 100644 --- a/tests/compiler.pure.lisp +++ b/tests/compiler.pure.lisp @@ -311,3 +311,33 @@ (push node path)) (when (funcall equalp key (node-key node)) (return (values node path t)))))))) + +;;; CONSTANTLY should return a side-effect-free function (bug caught +;;; by Paul Dietz' test suite) +(let ((i 0)) + (let ((fn (constantly (progn (incf i) 1)))) + (assert (= i 1)) + (assert (= (funcall fn) 1)) + (assert (= i 1)) + (assert (= (funcall fn) 1)) + (assert (= i 1)))) + +;;; Bug 240 reported by tonyms on #lisp IRC 2003-02-25 (modified version) +(loop for (fun warns-p) in + '(((lambda (&optional *x*) *x*) t) + ((lambda (&optional *x* &rest y) (values *x* y)) t) + ((lambda (&optional *print-base*) (values *print-base*)) nil) + ((lambda (&optional *print-base* &rest y) (values *print-base* y)) nil) + ((lambda (&optional *x*) (declare (special *x*)) (values *x*)) nil) + ((lambda (&optional *x* &rest y) (declare (special *x*)) (values *x* y)) nil)) + for real-warns-p = (nth-value 1 (compile nil fun)) + do (assert (eq warns-p real-warns-p))) + +;;; Bug reported by Gilbert Baumann on #lisp IRC 2003-03-26 +(assert (equal (funcall (eval '(lambda (x &optional (y (pop x))) (list x y))) + '(1 2)) + '((2) 1))) + +;;; Bug reported by Paul Dietz on cmucl-imp and fixed by Gerd +;;; Moellmann: CONVERT-MORE-CALL failed on the following call +(assert (eq (eval '((lambda (&key) 'u) :allow-other-keys nil)) 'u))