X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=tests%2Fcompiler.impure.lisp;h=26b12ce601e5733d8334097feec077d7659ee404;hb=8bc3c6490d56d4cfcdc72fd14b0d11764cf9f54d;hp=151f4002e8a97fea64f831c5e9f2c94e3edfb2bd;hpb=7c5a4db7b036edb8969b93db5c114df88995ee6e;p=sbcl.git diff --git a/tests/compiler.impure.lisp b/tests/compiler.impure.lisp index 151f400..26b12ce 100644 --- a/tests/compiler.impure.lisp +++ b/tests/compiler.impure.lisp @@ -1835,4 +1835,27 @@ (setf *mystery* :mystery) (assert (eq :ok (test-mystery (make-thing :slot :mystery)))) +;;; optimizing make-array +(defun count-code-callees (f) + (let ((code (sb-kernel:fun-code-header f)) + (n 0)) + (loop for i from sb-vm::code-constants-offset below (sb-kernel:get-header-data code) + for c = (sb-kernel:code-header-ref code i) + do (when (typep c 'fdefn) + (print c) + (incf n))) + n)) +(assert (zerop (count-code-callees + (compile nil + `(lambda (x y z) + (make-array '(3) :initial-contents (list x y z))))))) +(assert (zerop (count-code-callees + (compile nil + `(lambda (x y z) + (make-array '3 :initial-contents (vector x y z))))))) +(assert (zerop (count-code-callees + (compile nil + `(lambda (x y z) + (make-array '3 :initial-contents `(,x ,y ,z))))))) + ;;; success