Commit 4a093636 authored by pfdietz's avatar pfdietz

Free declaration scope tests

parent 91478b77
......@@ -43,6 +43,36 @@
(defun (setf defun-test-fun-4) (newval x)
(return-from defun-test-fun-4 (setf (car x) newval))))
(deftest defun.5
(let ((x 1))
(declare (special x))
(let ((x 2))
(defun defun-test-fun-5 (&aux (y x))
(declare (special x))
(values y x))
(defun-test-fun-5)))
2 1)
(deftest defun.6
(let ((x 1))
(declare (special x))
(let ((x 2))
(defun defun-test-fun-5 (&optional (y x))
(declare (special x))
(values y x))
(defun-test-fun-5)))
2 1)
(deftest defun.7
(let ((x 1))
(declare (special x))
(let ((x 2))
(defun defun-test-fun-5 (&key (y x))
(declare (special x))
(values y x))
(defun-test-fun-5)))
2 1)
;;; Error tests
(deftest defun.error.1
......
......@@ -112,6 +112,30 @@
(destructuring-bind (&rest x &key) nil x)
nil)
(deftest destructuring-bind.25
(let ((x :bad))
(declare (special x))
(let ((x :good))
(destructuring-bind (y) (list x)
(declare (special x))
y)))
:good)
(deftest destructuring-bind.26
(destructuring-bind (x) (list 1))
nil)
(deftest destructuring-bind.27
(destructuring-bind (x) (list 1)
(declare (optimize)))
nil)
(deftest destructuring-bind.28
(destructuring-bind (x) (list 1)
(declare (optimize))
(declare))
nil)
;;; Error cases
#|
......
......@@ -503,4 +503,21 @@
x)))
:good)
\ No newline at end of file
(deftest flet.67
(let ((x :bad))
(declare (special x))
(let ((x :good))
(flet ((%f (&aux (y x))
(declare (special x))
y))
(%f))))
:good)
(deftest flet.68
(let ((x :bad))
(declare (special x))
(let ((x :good))
(flet ((%f () x))
(declare (special x))
(%f))))
:good)
......@@ -343,3 +343,22 @@
(labels ((%f () (declare (special x))))
x)))
:good)
(deftest labels.46
(let ((x :bad))
(declare (special x))
(let ((x :good))
(labels ((%f (&aux (y x))
(declare (special x))
y))
(%f))))
:good)
(deftest labels.47
(let ((x :bad))
(declare (special x))
(let ((x :good))
(labels ((%f () x))
(declare (special x))
(%f))))
:good)
\ No newline at end of file
......@@ -71,6 +71,15 @@
(return 'bad))
2)
(deftest prog.11
(let ((x :bad))
(declare (special x))
(let ((x :good))
(prog ((y x))
(declare (special x))
(return y))))
:good)
(def-macro-test prog.error.1 (prog nil))
;;; Tests of PROG*
......@@ -141,4 +150,13 @@
(return 'bad))
2)
(deftest prog*.11
(let ((x :bad))
(declare (special x))
(let ((x :good))
(prog* ((y x))
(declare (special x))
(return y))))
:good)
(def-macro-test prog*.error.1 (prog* nil))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment