(error "bad RANDOM event"))))
;;; 0.8.17.28-sma.1 lost derived type information.
-(handler-bind ((sb-ext:compiler-note #'error))
- (compile nil
- '(lambda (x y v)
- (declare (optimize (speed 3) (safety 0)))
- (declare (type (integer 0 80) x)
- (type (integer 0 11) y)
- (type (simple-array (unsigned-byte 32) (*)) v))
- (setf (aref v 0) (* (* x #.(floor (ash 1 32) (* 11 80))) y))
- nil)))
+(with-test (:name "0.8.17.28-sma.1" :fails-on :sparc)
+ (handler-bind ((sb-ext:compiler-note (lambda (c) (error "~A" c))))
+ (compile nil
+ '(lambda (x y v)
+ (declare (optimize (speed 3) (safety 0)))
+ (declare (type (integer 0 80) x)
+ (type (integer 0 11) y)
+ (type (simple-array (unsigned-byte 32) (*)) v))
+ (setf (aref v 0) (* (* x #.(floor (ash 1 32) (* 11 80))) y))
+ nil))))
;;; Bug reported by Robert J. Macomber: instrumenting of more-entry
;;; prevented open coding of %LISTIFY-REST-ARGS.
;;; sbcl-devel)
(compile nil '(lambda (x y a b c)
(- y (* (signum x) (sqrt (abs (- (* b x) c)))))))
+
+;;; Type inference from CHECK-TYPE
+(let ((count0 0) (count1 0))
+ (handler-bind ((sb-ext:compiler-note (lambda (c) (incf count0))))
+ (compile nil '(lambda (x)
+ (declare (optimize (speed 3)))
+ (1+ x))))
+ ;; forced-to-do GENERIC-+, etc
+ (assert (> count0 0))
+ (handler-bind ((sb-ext:compiler-note (lambda (c) (incf count1))))
+ (compile nil '(lambda (x)
+ (declare (optimize (speed 3)))
+ (check-type x fixnum)
+ (1+ x))))
+ (assert (= count1 0)))
+
+;;; Up to 0.9.8.22 x86-64 had broken return value handling in the
+;;; %SET-SAP-REF-DOUBLE/SINGLE VOPs.
+(with-test (:name :sap-ref-float)
+ (compile nil '(lambda (sap)
+ (let ((x (setf (sb-vm::sap-ref-double sap 0) 1d0)))
+ (1+ x))))
+ (compile nil '(lambda (sap)
+ (let ((x (setf (sb-vm::sap-ref-single sap 0) 1d0)))
+ (1+ x)))))
+