. ./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.
# test case from Rudi for some CLOS WARNINGness that shouldn't have
# been there
cat > $tmpfilename <<EOF
+ #+sb-eval (eval-when (:compile-toplevel)
+ (setf sb-ext:*evaluator-mode* :compile))
+
(eval-when (:compile-toplevel :load-toplevel :execute)
(defstruct buffer-state
(output-index 0)))
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)
EOF
expect_clean_compile $tmpfilename
-rm $tmpfilename
-rm $compiled_tmpfilename
+cat > $tmpfilename <<EOF
+(defstruct foo
+ (bar #p"/tmp/"))
+EOF
+expect_clean_compile $tmpfilename
+
+cat > $tmpfilename <<EOF
+(eval-when (:compile-toplevel :load-toplevel :execute)
+ (defstruct foox)
+ (defmethod make-load-form ((foo foox) &optional env)
+ (declare (ignore env))
+ '(make-foox)))
+(defstruct bar
+ (foo #.(make-foox)))
+EOF
+expect_clean_compile $tmpfilename
+
+cat > $tmpfilename <<EOF
+(defun something (x) x)
+...
+(defun something-more (x) x)
+EOF
+expect_aborted_compile $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
# success
-exit 104
+exit $EXIT_TEST_WIN