+
+;;; Free special bindings only apply to the body of the binding form, not
+;;; the initialization forms.
+(assert (eq :good
+ (funcall (compile 'nil
+ (lambda ()
+ (let ((x :bad))
+ (declare (special x))
+ (let ((x :good))
+ ((lambda (&optional (y x))
+ (declare (special x)) y)))))))))
+
+;;; Bug from pfdietz's random tester: the compiler knew that IMAGPART of
+;;; a rational was zero, but didn't do the substitution, leading to a
+;;; crash in the ASH vop (since a shift of 57 wouldn't fit in the
+;;; machine's ASH instruction's immediate field) that the compiler
+;;; thought was legitimate.
+;;;
+;;; FIXME: this has been recorded as bug 383. The attempted fix (sbcl
+;;; 0.9.2.6) led to lots of spurious optimization notes. So the bug stil
+;;; exist and this test case serves as a reminder of the problem.
+;;; --njf, 2005-07-05
+#+nil
+(compile 'nil
+ (LAMBDA (B)
+ (DECLARE (TYPE (INTEGER -2 14) B))
+ (DECLARE (IGNORABLE B))
+ (ASH (IMAGPART B) 57)))
+
+;;; bug reported by Eduardo Mu\~noz
+(multiple-value-bind (fun warnings failure)
+ (compile nil '(lambda (struct first)
+ (declare (optimize speed))
+ (let* ((nodes (nodes struct))
+ (bars (bars struct))
+ (length (length nodes))
+ (new (make-array length :fill-pointer 0)))
+ (vector-push first new)
+ (loop with i fixnum = 0
+ for newl fixnum = (length new)
+ while (< newl length) do
+ (let ((oldl (length new)))
+ (loop for j fixnum from i below newl do
+ (dolist (n (node-neighbours (aref new j) bars))
+ (unless (find n new)
+ (vector-push n new))))
+ (setq i oldl)))
+ new)))
+ (declare (ignore fun warnings failure))
+ (assert (not failure)))