X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fcompiler.pure.lisp;h=a528b67a34165e447e079edeee5d9015f55aa4cc;hb=fe5cd1af557ea21675dc72c8c4c581781613025d;hp=4b0af785abbc68f842ca87f96a571ffc49a7310e;hpb=36a379d746b9eb74ba8c5afff40dc5dcb9f4557a;p=sbcl.git diff --git a/tests/compiler.pure.lisp b/tests/compiler.pure.lisp index 4b0af78..a528b67 100644 --- a/tests/compiler.pure.lisp +++ b/tests/compiler.pure.lisp @@ -2086,3 +2086,30 @@ (f (compile nil l))) (assert (funcall f :good)) (assert (nth-value 1 (ignore-errors (funcall f 42))))) + +;;; Check that the compiler doesn't munge *RANDOM-STATE*. +(let* ((state (make-random-state)) + (*random-state* (make-random-state state)) + (a (random most-positive-fixnum))) + (setf *random-state* state) + (compile nil `(lambda (x a) + (declare (single-float x) + (type (simple-array double-float) a)) + (+ (loop for i across a + summing i) + x))) + (assert (= a (random most-positive-fixnum)))) + +;;; MISC.641: LET-conversion after physical environment analysis lost NLX-INFOs +(let ((form '(lambda () + (declare (optimize (speed 1) (space 0) (debug 2) + (compilation-speed 0) (safety 1))) + (flet ((%f3 (f3-1 &key (key1 (count (floor 0 (min -74 0)) #()))) + 0)) + (apply #'%f3 0 nil))))) + (assert (zerop (funcall (compile nil form))))) + +;;; size mismatch: # disp=1> is a :DWORD and # is a :QWORD. on x86-64 +(compile nil '(lambda () + (let ((x (make-array '(1) :element-type '(signed-byte 32)))) + (setf (aref x 0) 1))))