X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fcompiler.pure.lisp;h=48cf250375a369b17f225ae744f8c15415a3021a;hb=877c7683fc42a2350a6a422433a1a9be02fe3c4f;hp=b3ef02cbb22cc2eae05c92cd0de59be4ff26a4b9;hpb=8b1ad2754eff900f83ca41a0ab853d79fc662854;p=sbcl.git diff --git a/tests/compiler.pure.lisp b/tests/compiler.pure.lisp index b3ef02c..48cf250 100644 --- a/tests/compiler.pure.lisp +++ b/tests/compiler.pure.lisp @@ -3232,3 +3232,32 @@ (vector i i i)) t)))) (ctu:assert-no-consing (funcall f)))) + +(with-test (:name :array-type-predicates) + (dolist (et sb-kernel::*specialized-array-element-types*) + (when et + (let* ((v (make-array 3 :element-type et)) + (fun (compile nil `(lambda () + (list + (if (typep ,v '(simple-array ,et (*))) + :good + :bad) + (if (typep (elt ,v 0) '(simple-array ,et (*))) + :bad + :good)))))) + (assert (equal '(:good :good) (funcall fun))))))) + +(with-test (:name :truncate-float) + (let ((s (compile nil `(lambda (x) + (declare (single-float x)) + (truncate x)))) + (d (compile nil `(lambda (x) + (declare (double-float x)) + (truncate x))))) + ;; Check that there is no generic arithmetic + (assert (not (search "GENERIC" + (with-output-to-string (out) + (disassemble s :stream out))))) + (assert (not (search "GENERIC" + (with-output-to-string (out) + (disassemble d :stream out)))))))