X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=contrib%2Fsb-cltl2%2Ftests.lisp;h=a314d8da6b5b57ae9eaabeeb28ad5ee73566a07d;hb=9af8ab0a80bbd4d579ed4a12d2a2819a7490901a;hp=137b0559902b903fe080be50ebb25a00e561d970;hpb=b3fc19fd2ee925f1a16e301012094b58c2cfd68a;p=sbcl.git diff --git a/contrib/sb-cltl2/tests.lisp b/contrib/sb-cltl2/tests.lisp index 137b055..a314d8d 100644 --- a/contrib/sb-cltl2/tests.lisp +++ b/contrib/sb-cltl2/tests.lisp @@ -6,7 +6,7 @@ ;;;; more information. (defpackage :sb-cltl2-tests - (:use :sb-cltl2 :cl :sb-rt)) + (:use :sb-cltl2 :cl :sb-rt :sb-ext)) (in-package :sb-cltl2-tests) @@ -168,6 +168,26 @@ (var-info x)) (:lexical t nil)) +(deftest variable-info.lexical.type + (let ((x 42)) + (declare (fixnum x)) + (var-info x)) + (:lexical t ((type . fixnum)))) + +(deftest variable-info.lexical.type.2 + (let ((x 42)) + (prog1 + (var-info x) + (locally (declare (fixnum x)) + (assert (plusp x))))) + (:lexical t nil)) + +(deftest variable-info.lexical.type.3 + (let ((x 42)) + (locally (declare (fixnum x)) + (var-info x))) + (:lexical t ((type . fixnum)))) + (deftest variable-info.ignore (let ((x 8)) (declare (ignore x)) @@ -189,6 +209,16 @@ (var-info #:undefined) (nil nil nil)) +(declaim (global this-is-global)) +(deftest global-variable + (var-info this-is-global) + (:global nil nil)) + +(defglobal this-is-global-too 42) +(deftest global-variable.2 + (var-info this-is-global-too) + (:global nil ((always-bound . t)))) + ;;;; FUNCTION-INFORMATION (defmacro fun-info (var &environment env) @@ -249,4 +279,3 @@ (fun-info identity)) (:function nil ((inline . inline) (ftype function (t) (values t &optional))))) -