1 ;;;; tests that dynamic-extent functionality works.
3 ;;;; This software is part of the SBCL system. See the README file for
6 ;;;; While most of SBCL is derived from the CMU CL system, the test
7 ;;;; files (like this one) were written from scratch after the fork
10 ;;;; This software is in the public domain and is provided with
11 ;;;; absolutely no warranty. See the COPYING and CREDITS files for
12 ;;;; more information.
15 (defmacro defun-with-dx (name arglist &body body)
17 (declare (optimize sb-c::stack-allocate-dynamic-extent))
21 (defun-with-dx dxlength (&rest rest)
22 (declare (dynamic-extent rest))
25 (assert (= (dxlength 1 2 3) 3))
26 (assert (= (dxlength t t t t t t) 6))
27 (assert (= (dxlength) 0))
30 (destructuring-bind (a b c d e f &rest g) list
31 (+ a b c d e f (length g))))
33 (defun-with-dx dxcaller (&rest rest)
34 (declare (dynamic-extent rest))
37 (assert (= (dxcaller 1 2 3 4 5 6 7) 22))
39 (sb-ext:quit :unix-status 104)