tmpcore=$TEST_FILESTEM.core
tmpoutput=$TEST_FILESTEM.txt
+run_sbcl <<EOF
+ (save-lisp-and-die "$tmpcore" :toplevel (lambda () 42))
+EOF
+run_sbcl_with_core "$tmpcore" --no-userinit --no-sysinit
+check_status_maybe_lose "SAVE-LISP-AND-DIE :TOPLEVEL" $? 0 "(saved core ran)"
+
# In sbcl-0.7.7 SAVE-LISP-AND-DIE didn't work at all because of
# flakiness caused by consing/GC/purify twice-and-at-least-twice
# mismatch grot.
exit 1
fi
+# saving runtime options _from_ executable cores
+run_sbcl <<EOF
+ (save-lisp-and-die "$tmpcore" :executable t)
+EOF
+chmod u+x "$tmpcore"
+./"$tmpcore" --no-userinit <<EOF
+ (save-lisp-and-die "$tmpcore" :executable t :save-runtime-options t)
+EOF
+chmod u+x "$tmpcore"
+./"$tmpcore" --no-userinit --version --eval '(quit)' <<EOF
+ (when (equal *posix-argv* '("./$tmpcore" "--version" "--eval" "(quit)"))
+ (quit :unix-status 42))
+EOF
+status=$?
+if [ $status != 42 ]; then
+ echo "saving runtime options from executable failed"
+ exit 1
+fi
+
exit $EXIT_TEST_WIN