368243c09993f7ee8b56c7ba184bef134a91607c
[sbcl.git] / tests / compiler-1.impure.lisp
1 (cl:in-package :cl-user)
2
3 (declaim (optimize (debug 3) (speed 2) (space 1)))
4
5 ;;; Until version 0.6.9 or so, SBCL's version of Python couldn't this
6 ;;; correctly, due to the bug patched by Rob MacLachlan on the
7 ;;; cmucl-imp list 2000-06-21, and apply to SBCL by Martin Atzmueller.
8 ;;; (The effectiveness of the test also depends on the implicit
9 ;;; function typing of Python (where DEFUN is like DECLAIM FTYPE),
10 ;;; which violates the ANSI spec, and should be fixed. Once that
11 ;;; unrelated bug is fixed, this code will no longer test the type
12 ;;; inference behavior it's intended to test.)
13 (defun emptyvalues (&rest rest) (declare (ignore rest)) (values))
14 (defstruct foo x y)
15 (defun bar ()
16   (let ((res (emptyvalues)))
17     (unless (typep res 'foo)
18       'expected-value)))
19 (assert (eq (bar) 'expected-value))
20
21 (sb-ext:quit :unix-status 104) ; success