1.0.28.12: preserve non-toplevelness of macro subforms
[sbcl.git] / tests / compiler.test.sh
index ce1566f..6a816df 100644 (file)
@@ -13,9 +13,9 @@
 
 . ./expect.sh
 
-base_tmpfilename="compiler-test-$$-tmp"
-tmpfilename="$base_tmpfilename.lisp"
-compiled_tmpfilename="$base_tmpfilename.fasl"
+use_test_subdirectory
+
+tmpfilename="$TEST_FILESTEM.lisp"
 
 # This should fail, as type inference should show that the call to FOO
 # will return something of the wrong type.
@@ -348,6 +348,13 @@ EOF
 expect_failed_compile $tmpfilename
 
 cat > $tmpfilename <<EOF
+x
+y
+z
+EOF
+expect_failed_compile $tmpfilename
+
+cat > $tmpfilename <<EOF
 (declaim (optimize (speed 3) (space 0) (safety 0)))
 
 (defun foo (bar)
@@ -379,7 +386,24 @@ cat > $tmpfilename <<EOF
 EOF
 expect_aborted_compile $tmpfilename
 
-rm $tmpfilename
+cat > $tmpfilename <<EOF
+(if t (locally))
+EOF
+expect_clean_cload $tmpfilename
+
+cat > $tmpfilename <<EOF
+(defconstant cl-package (find-package :cl))
+(defun cl-symbol-p (x)
+  (eq (symbol-package x) cl-package))
+EOF
+expect_clean_cload $tmpfilename
+
+cat > $tmpfilename <<EOF
+(and (eval-when (:compile-toplevel) (error "oops AND")))
+(or (eval-when (:compile-toplevel) (error "oops OR")))
+(cond (t (eval-when (:compile-toplevel) (error "oops COND"))))
+EOF
+expect_clean_cload $tmpfilename
 
 # success
-exit 104
+exit $EXIT_TEST_WIN