+check_status_maybe_lose "Basic SAVE-LISP-AND-DIE" $? 21 "(saved core ran)"
+
+# In sbcl-0.9.8 saving cores with callbacks didn't work on gencgc platforms
+run_sbcl <<EOF
+ (defun bar ()
+ (format t "~&Callbacks not supported, skipping~%")
+ (quit :unix-status 42))
+ #+alien-callbacks
+ (progn
+ (sb-alien::define-alien-callback foo int () 42)
+ (defun bar () (quit :unix-status (alien-funcall foo))))
+ (save-lisp-and-die "$tmpcore")
+EOF
+run_sbcl_with_core "$tmpcore" --no-userinit --no-sysinit <<EOF
+ (bar)
+EOF
+check_status_maybe_lose "Callbacks after SAVE-LISP-AND-DIE" $? \
+ 42 "(callback function ran)"
+
+# test suppression of banner in executable cores
+run_sbcl <<EOF
+ (save-lisp-and-die "$tmpcore" :executable t)
+EOF
+chmod u+x "$tmpcore"
+./"$tmpcore" > "$tmpoutput" --no-userinit --no-sysinit --noprint <<EOF
+ (quit :unix-status 71)
+EOF
+status=$?
+if [ $status != 71 ]; then
+ echo "failure in banner suppression: $status"
+ exit 1
+elif [ -s "$tmpoutput" ]; then
+ echo "failure in banner suppression: nonempty output:"
+ echo ---
+ cat "$tmpoutput"
+ echo ---
+ exit 1
+elif [ -f "$tmpoutput" ]; then
+ echo "/Executable suppressed banner, good."