X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fcompiler.impure.lisp;h=46f15ef42f98ac2bd16f704ffd58c618314e13a0;hb=e76ddf242a31a2acaae3a9cb818fa31500ebbf92;hp=37b12fc5763cda9d5fcda28f3d40de1e98298b71;hpb=12bd68a3ff68b4e06cfb8c441383b6e898d2ed78;p=sbcl.git diff --git a/tests/compiler.impure.lisp b/tests/compiler.impure.lisp index 37b12fc..46f15ef 100644 --- a/tests/compiler.impure.lisp +++ b/tests/compiler.impure.lisp @@ -702,6 +702,31 @@ BUG 48c, not yet fixed: (do-optimizations (compile nil '(lambda (x) (let ((y (error ""))) (list x y))))) +;;; bug 223: invalid moving of global function name referencing +(defun bug223-int (n) + `(int ,n)) + +(defun bug223-wrap () + (let ((old #'bug223-int)) + (setf (fdefinition 'bug223-int) + (lambda (n) + (assert (> n 0)) + `(ext ,@(funcall old (1- n))))))) +(compile 'bug223-wrap) + +(assert (equal (bug223-int 4) '(int 4))) +(bug223-wrap) +(assert (equal (bug223-int 4) '(ext int 3))) +(bug223-wrap) +(assert (equal (bug223-int 4) '(ext ext int 2))) + +;;; COERCE got its own DEFOPTIMIZER which has to reimplement most of +;;; SPECIFIER-TYPE-NTH-ARG. For a while, an illegal type would throw +;;; you into the debugger on compilation. +(defun coerce-defopt (x) + ;; illegal, but should be compilable. + (coerce x '(values t))) +(assert (null (ignore-errors (coerce-defopt 3)))) ;;;; tests not in the problem domain, but of the consistency of the ;;;; compiler machinery itself