Trust non-returning functions during sb-xc.
[sbcl.git] / tests / save2.test.sh
blobec6d303ac6871a7e56dd7ad20224a7a98466fc96
1 . ./subr.sh
3 use_test_subdirectory
5 tmpcore=$TEST_FILESTEM.core
7 # This test asserts that the :TOPLEVEL function is allowed to return with
8 # an arbitrary value that does _not_ propagate into the exit status.
9 run_sbcl <<EOF
10 (save-lisp-and-die "$tmpcore" :toplevel (lambda () 42))
11 EOF
12 run_sbcl_with_core "$tmpcore" --noinform --no-userinit --no-sysinit \
13 --eval "(setf sb-ext:*evaluator-mode* :${TEST_SBCL_EVALUATOR_MODE:-compile})"
14 check_status_maybe_lose "SAVE-LISP-AND-DIE :TOPLEVEL" $? 0 "(saved core ran)"
16 run_sbcl --eval '(save-lisp-and-die "'$tmpcore'" :toplevel (lambda () (format t "Ahoy-hoy.~%")))'
17 result1=`run_sbcl_with_core "$tmpcore" --noinform --no-userinit --no-sysinit`
18 result2=`run_sbcl_with_core "$tmpcore" --merge-core-pages --noinform --no-userinit --no-sysinit`
19 # Both invocations should produce the "Ahoy-hoy." but result2 didn't
20 # because of busted arg parsing in git rev f0a7f17516
21 # result2 has to be string-quoted in case it contains junk (due to not parsing
22 # --noinform after incorrectly parsing --merge-core-pages)
23 if [ ${result1} != "Ahoy-hoy." -o "${result2}" != ${result1} ]
24 then
25 echo FAIL: merge-core-pages
26 exit 0
28 # Passing doesn't actually mean we utilized madvise,
29 # just that we didn't choke on the argument.
30 echo PASS: merge-core-pages
32 exit $EXIT_TEST_WIN