summaryrefslogtreecommitdiff
path: root/tests/bad-code.pure.lisp
diff options
context:
space:
mode:
authorStas Boukarev <stassats@gmail.com>2018-01-02 18:10:29 +0300
committerStas Boukarev <stassats@gmail.com>2018-01-02 18:22:04 +0300
commit7507713ee8790012cb2d5c522d07cb7b7d58c781 (patch)
treef9905bd52032c1bd62e37d21271570c037638d63 /tests/bad-code.pure.lisp
parent03ec4db2124547cd9925b81b8daa546fe5b40065 (diff)
Don't allow &aux to bind constants.
Fixes lp#1740868.
Diffstat (limited to 'tests/bad-code.pure.lisp')
-rw-r--r--tests/bad-code.pure.lisp81
1 files changed, 81 insertions, 0 deletions
diff --git a/tests/bad-code.pure.lisp b/tests/bad-code.pure.lisp
new file mode 100644
index 000000000..80ff4d8f9
--- /dev/null
+++ b/tests/bad-code.pure.lisp
@@ -0,0 +1,81 @@
+(in-package :cl-user)
+
+(with-test (:name (make-array :bad-initial-contents))
+ (assert
+ (nth-value 1
+ (checked-compile
+ `(lambda () (make-array '(1) :initial-contents 'foo))
+ :allow-warnings t))))
+
+(with-test (:name (make-string-output-stream :bad-element-type))
+ (assert
+ (nth-value 1
+ (checked-compile
+ `(lambda ()
+ (make-string-output-stream :element-type '((x))))
+ :allow-warnings t))))
+
+(with-test (:name (coerce :bad-type-specifier))
+ (assert
+ (nth-value 1
+ (checked-compile
+ `(lambda () (coerce (list 2) 1))
+ :allow-warnings t))))
+
+(with-test (:name :zombie-entry-point-reference)
+ (assert
+ (nth-value 1
+ (checked-compile
+ `(lambda () (labels ((%f ())) (%f #'%f)))
+ :allow-warnings t))))
+(with-test (:name :ir1-optimize-combination-dead-node)
+ (assert
+ (nth-value 1
+ (checked-compile
+ `(lambda ()
+ (flet ((%f2 (x) x))
+ (list (%f2 1)
+ (multiple-value-call #'%f2 (values)))))
+ :allow-warnings t))))
+
+(with-test (:name (:bogus-block &key))
+ (assert
+ (nth-value 1
+ (checked-compile `(lambda (&key (x (block 1 10))) x)
+ :allow-failure t))))
+
+(with-test (:name :type-error-reporting)
+ (assert
+ (nth-value 1
+ (checked-compile `(lambda ()
+ (lambda ()
+ (let ((v3 0))
+ (cdr (1- (block b5 (if nil v3 0)))))))
+ :allow-warnings t))))
+
+(with-test (:name :dx-on-deleted-nodes)
+ (assert
+ (nth-value 1
+ (checked-compile `(lambda ()
+ (restart-bind ((1 3))))
+ :allow-warnings t))))
+
+(with-test (:name :transform-call-dfo-consistency)
+ (assert
+ (nth-value 1
+ (checked-compile
+ `(lambda ()
+ (flet ((%f (&optional x) x))
+ (%f)
+ ;; Two of the %f calls are erroneous, with an extra argument
+ (flet ((%f6 (&key (k (%f (%f -1 (%f -2 -3))))) 0))
+ 5)))
+ :allow-warnings t))))
+
+(with-test (:name :&aux-check-variable-names)
+ (assert
+ (nth-value 1
+ (checked-compile
+ `(lambda (&aux (nil 10))
+ nil)
+ :allow-failure t))))