X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fcompiler.pure.lisp;h=72403638c11e31b121179798bf5b7551c1a20914;hb=1d46d379bb7a6424524b978f213ef69be5f1ad69;hp=0e493f5085da6e8213474513a26c156c100c806f;hpb=64ec717cf13c44fb4571c1fd7fbd508551ecfe01;p=sbcl.git diff --git a/tests/compiler.pure.lisp b/tests/compiler.pure.lisp index 0e493f5..7240363 100644 --- a/tests/compiler.pure.lisp +++ b/tests/compiler.pure.lisp @@ -1094,3 +1094,43 @@ :good (values result1 result2)))) :good)) +;;; MISC.275 +(assert + (zerop + (funcall + (compile + nil + '(lambda (b) + (declare (notinline funcall min coerce)) + (declare + (optimize (speed 1) + (space 2) + (safety 2) + (debug 1) + (compilation-speed 1))) + (flet ((%f12 (f12-1) + (coerce + (min + (if f12-1 (multiple-value-prog1 + b (return-from %f12 0)) + 0)) + 'integer))) + (funcall #'%f12 0)))) + -33))) + +;;; Discussion of a CMUCL PCL bug on Sparc with Raymond Toy revealed a +;;; potential problem: optimizers and type derivers for MAX and MIN +;;; were not consistent in treating EQUALP, but not EQL, arguments. +(dolist (f '(min max)) + (loop for complex-arg-args in '((1d0 2d0) (0d0 1d0)) + for complex-arg = `(if x ,@complex-arg-args) + do + (loop for args in `((1 ,complex-arg) + (,complex-arg 1)) + for form = `(,f ,@args) + for f1 = (compile nil `(lambda (x) ,form)) + and f2 = (compile nil `(lambda (x) (declare (notinline min max)) + ,form)) + do + (dolist (x '(nil t)) + (assert (eql (funcall f1 x) (funcall f2 x)))))))