X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fcompiler.pure-cload.lisp;h=b61f5e525b1ec2f0d60d42e932f1a8960d877e19;hb=0ba72140fb0956f4cafd7b4aca6b6ffb0aa83c05;hp=e1cba004ef00c442cfbda05431ff29c0375e9c85;hpb=c58795f37078f5900aff5dc4a3712fbadd2d432e;p=sbcl.git diff --git a/tests/compiler.pure-cload.lisp b/tests/compiler.pure-cload.lisp index e1cba00..b61f5e5 100644 --- a/tests/compiler.pure-cload.lisp +++ b/tests/compiler.pure-cload.lisp @@ -60,12 +60,71 @@ a b) '(1 2 :a 1 2)))) +;;; bug in LOOP, reported by ??? on c.l.l +(flet ((foo (l) + (loop for x in l + when (symbolp x) return x + while (numberp x) + collect (list x)))) + (assert (equal (foo '(1 2 #\a 3)) '((1) (2)))) + (assert (equal (foo '(1 2 x 3)) 'x))) + +;;; compiler failure found by Paul Dietz' randomized tortuter +(defun #:foo (a b c d) + (declare (type (integer 240 100434465) a) + (optimize (speed 3) (safety 1) (debug 1))) + (logxor + (if (ldb-test (byte 27 4) d) + -1 + (max 55546856 -431)) + (logorc2 + (if (>= 0 b) + (if (> b c) (logandc2 c d) (if (> d 224002) 0 d)) + (signum (logior c b))) + (logior a -1)))) + +(defun #:foo (b c) + (declare (type (integer -23228343 2) b) + (type (integer -115581022 512244512) c) + (optimize (speed 3) (safety 1) (debug 1))) + (* (* (logorc2 3 (deposit-field 4667947 (byte 14 26) b)) + (deposit-field b (byte 25 27) -30424886)) + (dpb b (byte 23 29) c))) + +(defun #:foo (x y) + (declare (type (integer -1 1000000000000000000000000) x y) + (optimize speed)) + (* x (* y x))) + +(defun #:foo (b) + (declare (type (integer -290488443 2) b) + (optimize (speed 3) (safety 1) (debug 1))) + (let ((v3 (min -1720 b))) (max v3 (logcount (if (= v3 b) b b))))) + +(defun #:foo (d) + (let ((v7 (flet ((%f16 () (labels ((%f3 () -8)) (%f3)))) + (labels ((%f7 () (%f16))) d)))) + 132887443)) + +;;; RESULT-FORM in DO is not contained in the implicit TAGBODY +(assert (eq (handler-case (eval `(do ((x '(1 2 3) (cdr x))) + ((endp x) (go :loop)) + :loop + (unless x (return :bad)))) + (error () :good)) + :good)) +(assert (eq (handler-case (eval `(do* ((x '(1 2 3) (cdr x))) + ((endp x) (go :loop)) + :loop + (unless x (return :bad)))) + (error () :good)) + :good)) + ;;; bug 282 ;;; ;;; Verify type checking policy in full calls: the callee is supposed ;;; to perform check, but the results should not be used before the ;;; check will be actually performed. -#+nil (locally (declare (optimize (safety 3))) (flet ((bar (f a) @@ -84,3 +143,7 @@ (make-array 1 :element-type '(unsigned-byte 32) :initial-element n)) nil))))))) + +;;; bug 261 +(let ((x (list (the (values &optional fixnum) (eval '(values)))))) + (assert (equal x '(nil))))