X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fdynamic-extent.impure.lisp;h=5111404907d01ff0601542af8ab249f74f08c0e7;hb=062283b901155792f65775491aea51481c56faaa;hp=6c83f8a49bbc1d7ba2350992326e7b8fc4fc9935;hpb=1d06300e09f767a38bbe6d5b38232ca334ab1913;p=sbcl.git diff --git a/tests/dynamic-extent.impure.lisp b/tests/dynamic-extent.impure.lisp index 6c83f8a..5111404 100644 --- a/tests/dynamic-extent.impure.lisp +++ b/tests/dynamic-extent.impure.lisp @@ -21,8 +21,17 @@ sb-ext:*stack-allocate-dynamic-extent* t) (defmacro defun-with-dx (name arglist &body body) - `(defun ,name ,arglist - ,@body)) + (let ((debug-name (sb-int:symbolicate name "-HIGH-DEBUG")) + (default-name (sb-int:symbolicate name "-DEFAULT"))) + `(progn + (defun ,debug-name ,arglist + (declare (optimize debug)) + ,@body) + (defun ,default-name ,arglist + ,@body) + (defun ,name (&rest args) + (apply #',debug-name args) + (apply #',default-name args))))) (declaim (notinline opaque-identity)) (defun opaque-identity (x) @@ -576,7 +585,6 @@ (with-test (:name (:no-consing :dx-vectors) :skipped-on '(not :stack-allocatable-vectors)) (assert-no-consing (force-make-array-on-stack 128)) - (assert-no-consing (make-array-on-stack-1)) (assert-no-consing (make-array-on-stack-2 5 '(1 2.0 3 4.0 5))) (assert-no-consing (make-array-on-stack-3 9 8 7)) (assert-no-consing (make-array-on-stack-4)) @@ -587,6 +595,7 @@ :fails-on :x86 :skipped-on `(not (and :stack-allocatable-vectors :c-stack-is-control-stack))) + (assert-no-consing (make-array-on-stack-1)) (assert-no-consing (make-array-on-stack-6)) (assert-no-consing (make-array-on-stack-7)) (assert-no-consing (make-array-on-stack-8)) @@ -624,6 +633,21 @@ (with-test (:name (:no-consing :hash-tables) :fails-on '(and :ppc :sb-thread)) (assert-no-consing (test-hash-table))) +;;; Both with-pinned-objects and without-gcing should not cons + +(defun call-without-gcing (fun) + (sb-sys:without-gcing (funcall fun))) + +(defun call-with-pinned-object (fun obj) + (sb-sys:with-pinned-objects (obj) + (funcall fun obj))) + +(with-test (:name (:no-consing :without-gcing)) + (assert-no-consing (call-without-gcing (lambda ())))) + +(with-test (:name (:no-consing :with-pinned-objects)) + (assert-no-consing (call-with-pinned-object #'identity 42))) + ;;; with-mutex should use DX and not cons (defvar *mutex* (sb-thread::make-mutex :name "mutexlock")) @@ -682,7 +706,7 @@ (bdowning-2005-iv-16)) (declaim (inline my-nconc)) -(defun-with-dx my-nconc (&rest lists) +(defun my-nconc (&rest lists) (declare (dynamic-extent lists)) (apply #'nconc lists)) (defun-with-dx my-nconc-caller (a b c) @@ -1089,3 +1113,11 @@ (assert (every (lambda (x) (sb-sys:sap= x (sb-sys:int-sap (+ 16 (ash 1 (1- width)))))) (funcall f (sb-sys:int-sap (ash 1 (1- width)))))))) + +(with-test (:name :&more-bounds) + ;; lp#1154946 + (assert (not (funcall (compile nil '(lambda (&rest args) (car args)))))) + (assert (not (funcall (compile nil '(lambda (&rest args) (nth 6 args)))))) + (assert (not (funcall (compile nil '(lambda (&rest args) (elt args 10)))))) + (assert (not (funcall (compile nil '(lambda (&rest args) (cadr args)))))) + (assert (not (funcall (compile nil '(lambda (&rest args) (third args)))))))