Trust non-returning functions during sb-xc.
[sbcl.git] / tests / save6.test.sh
blob5dc050219cffc5891c66f2f5faede8faec2cdd82
1 . ./subr.sh
3 use_test_subdirectory
5 tmpcore=${TEST_FILESTEM}_a.core
6 # unix can write a new file to same name as the one we're executing
7 # but not all OSes can
8 tmpcore2=${TEST_FILESTEM}_b.core
10 # Regression test for https://bugs.launchpad.net/sbcl/+bug/411925
11 # saving runtime options _from_ executable cores
12 run_sbcl <<EOF
13 (save-lisp-and-die "$tmpcore" :executable t)
14 EOF
15 chmod u+x "$tmpcore"
16 ./"$tmpcore" --no-userinit --no-sysinit --noprint <<EOF
17 (save-lisp-and-die "$tmpcore2" :executable t :save-runtime-options t)
18 EOF
19 chmod u+x "$tmpcore2"
20 ./"$tmpcore2" --no-userinit --no-sysinit --noprint --versions --eval '(exit)' <<EOF
21 ;; tbh I have no idea how this asserts anything about saving options from executable
22 ;; cores with saved options
23 (when #+unix (equal *posix-argv* '("./$tmpcore2" "--versions" "--eval" "(exit)"))
24 #-unix (equal (cdr *posix-argv*) '("--versions" "--eval" "(exit)"))
25 (exit :code 42))
26 EOF
27 status=$?
28 rm "$tmpcore" "$tmpcore2"
29 if [ $status -ne 42 ]; then
30 echo "saving runtime options from executable failed"
31 exit 1
34 exit $EXIT_TEST_WIN