Update of /cvsroot/sbcl/sbcl/tests
In directory sc8-pr-cvs1:/tmp/cvs-serv28413/tests
Modified Files:
compiler.impure-cload.lisp compiler.pure-cload.lisp
compiler.pure.lisp
Log Message:
0.8.3.11:
* New bug 282;
* remove bug entry 233a;
... add a test for it.
Index: compiler.impure-cload.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/tests/compiler.impure-cload.lisp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- compiler.impure-cload.lisp 25 Jun 2003 04:43:51 -0000 1.3
+++ compiler.impure-cload.lisp 29 Aug 2003 08:45:38 -0000 1.4
@@ -1,3 +1,6 @@
+(load "assertoid.lisp")
+(use-package "ASSERTOID")
+
;;; bug 254: compiler falure
(defpackage :bug254 (:use :cl))
(in-package :bug254)
@@ -138,6 +141,17 @@
'((4 9 7) (3 8 6) (6 8 3))))
(delete-package :bug258)
+
+;;;
+(defun bug233a (x)
+ (declare (optimize (speed 2) (safety 3)))
+ (let ((y 0d0))
+ (values
+ (the double-float x)
+ (setq y (+ x 1d0))
+ (setq x 3d0)
+ (funcall (eval ''list) y (+ y 2d0) (* y 3d0)))))
+(assert (raises-error? (bug233a 4) type-error))
(sb-ext:quit :unix-status 104)
Index: compiler.pure-cload.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/tests/compiler.pure-cload.lisp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- compiler.pure-cload.lisp 1 Nov 2002 17:31:50 -0000 1.5
+++ compiler.pure-cload.lisp 29 Aug 2003 08:45:38 -0000 1.6
@@ -59,3 +59,28 @@
(symbol-value 'a))
a b)
'(1 2 :a 1 2))))
+
+;;; 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)
+ (declare (type (simple-array (unsigned-byte 32) (*)) a))
+ (declare (type (function (fixnum)) f))
+ (funcall f (aref a 0))))
+ (assert
+ (eval `(let ((n (1+ most-positive-fixnum)))
+ (if (not (typep n '(unsigned-byte 32)))
+ (warn 'style-warning
+ "~@<This test is written for platforms with ~
+ ~@<(proper-subtypep 'fixnum '(unsigned-byte 32))~:@>.~:@>")
+ (block nil
+ (funcall ,#'bar
+ (lambda (x) (when (eql x n) (return t)))
+ (make-array 1 :element-type '(unsigned-byte 32)
+ :initial-element n))
+ nil)))))))
Index: compiler.pure.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/tests/compiler.pure.lisp,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -d -r1.54 -r1.55
--- compiler.pure.lisp 27 Aug 2003 06:49:16 -0000 1.54
+++ compiler.pure.lisp 29 Aug 2003 08:45:38 -0000 1.55
@@ -512,10 +512,11 @@
;;; We suppose that INTEGER arithmetic cannot be efficient, and the
;;; compiler has an optimized VOP for +; so this code should cause an
;;; efficiency note.
-(assert (eq (handler-case
- (compile nil '(lambda (i)
- (declare (optimize speed))
- (declare (type integer i))
- (+ i 2)))
- (sb-ext:compiler-note (c) (return :good)))
+(assert (eq (block nil
+ (handler-case
+ (compile nil '(lambda (i)
+ (declare (optimize speed))
+ (declare (type integer i))
+ (+ i 2)))
+ (sb-ext:compiler-note (c) (return :good))))
:good))
|