Fix make-array transforms.
[sbcl.git] / tests / interface.test.sh
1 #!/bin/sh
2
3 # tests for problems in the interface presented to the user/programmer
4
5 # This software is part of the SBCL system. See the README file for
6 # more information.
7 #
8 # While most of SBCL is derived from the CMU CL system, the test
9 # files (like this one) were written from scratch after the fork
10 # from CMU CL.
11 #
12 # This software is in the public domain and is provided with
13 # absolutely no warranty. See the COPYING and CREDITS files for
14 # more information.
15
16 . ./subr.sh
17
18 use_test_subdirectory
19
20 tmpscript=$TEST_FILESTEM.lisp-script
21
22 # bug 881445
23 case "$SBCL_MACHINE_TYPE" in
24     X86-64)
25         cat > $tmpscript <<EOF
26 (let ((x (make-array (1- (expt 2 32)) :element-type '(unsigned-byte 8))))
27   (assert (> (sb-kernel:dynamic-usage) (length x)))
28   ;; prevent compiler from getting too smart...
29   (eval x)
30   (sb-ext:quit :unix-status $EXIT_LISP_WIN))
31 EOF
32         run_sbcl_with_args --dynamic-space-size 5GB $SBCL_ARGS --load $tmpscript
33         check_status_maybe_lose "bug 881445" $?
34         ;;
35 esac
36
37 run_sbcl --eval '(sb-ext:exit)'
38 check_status_maybe_lose "simple exit" $? 0 "ok"
39
40 run_sbcl --eval '(sb-ext:exit :code 42)'
41 check_status_maybe_lose "exit with code" $? 42 "ok"
42
43 run_sbcl --eval '(progn (defvar *exit-code* 100) (push (lambda () (exit :code (decf *exit-code*))) *exit-hooks*) #+sb-thread (sb-thread:make-thread (lambda () (exit :code 13))) #-sb-thread (exit :code 13))'
44 check_status_maybe_lose "exit with code" $? 99 "ok"
45
46 run_sbcl --eval '(unwind-protect (sb-ext:exit :code 13 :abort t) (sb-ext:exit :code 7 :abort t))'
47 check_status_maybe_lose "exit with abort" $? 13 "ok"
48
49 run_sbcl --eval '(unwind-protect (sb-ext:exit :code 0 :abort t) (sb-ext:exit :code 7 :abort t))'
50 check_status_maybe_lose "exit with abort and code 0" $? 0 "ok"
51
52 run_sbcl --eval '(unwind-protect (sb-ext:exit :code 0 :abort nil) (sb-ext:exit :code 7))'
53 check_status_maybe_lose "exit with abort and code 0" $? 7 "ok"
54
55 exit $EXIT_TEST_WIN