X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fdynamic-extent.impure.lisp;h=9b06fd761167e766eddd427a9677d228ea10fc70;hb=a189a69454ef7635149319ae213b337f17c50d20;hp=6841e4d6b05c3dc734c7a6646e48feb5fe3a15fc;hpb=d90c8a75da90925a51a587f7bd4d9c494256f68a;p=sbcl.git diff --git a/tests/dynamic-extent.impure.lisp b/tests/dynamic-extent.impure.lisp index 6841e4d..9b06fd7 100644 --- a/tests/dynamic-extent.impure.lisp +++ b/tests/dynamic-extent.impure.lisp @@ -518,7 +518,8 @@ (declare (dynamic-extent x)) (unless (equalp (caar x) (make-nested-good :bar *bar*)) (error "got ~S, wanted ~S" (caar x) (make-nested-good :bar *bar*))) - (caar x))) + ;; the NESTED instance itself *should* be DX! + (copy-nested (caar x)))) (with-test (:name :conservative-nested-dx) ;; NESTED-BAD should not stack-allocate :BAR due to the SETF. @@ -585,7 +586,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)) @@ -596,6 +596,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)) @@ -633,6 +634,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")) @@ -1098,3 +1114,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)))))))