1 (unless (gethash 'sb-c
:jump-table sb-c
::*backend-parsed-vops
*)
2 (invoke-restart 'run-tests
::skip-file
))
4 (with-test (:name
:symbol-case-as-jump-table
)
5 ;; Assert that a prototypical example of (CASE symbol ...)
6 ;; was converted to a jump table.
7 (let ((c (sb-kernel:fun-code-header
#'sb-debug
::parse-trace-options
)))
8 (assert (>= (sb-kernel:code-jump-table-words c
) 14))))
10 (with-test (:name
:type-derivation
)
13 (declare ((member a b c d
) x
)
24 (declare ((member a b c d
) x
)
49 (declare ((integer 1 5) a
))
58 (declare ((integer 1 5) a
))
66 (with-test (:name
:type-derivation-constraints
)
69 (declare ((not (member b
)) x
)
79 (or null
(integer 3 6)))
100 (defstruct (achild (:include a
)))
101 (defstruct (agrandchild (:include achild
)))
102 (defstruct (achild2 (:include a
)))
107 (defstruct (echild (:include e
)))
110 (declaim (freeze-type a b c d e f
))
111 (defun typecase-jump-table (x)
116 ((or d e
) 'is-d-or-e
)
118 (compile 'typecase-jump-table
)
120 (with-test (:name
:typecase-jump-table
)
121 (assert (eql (sb-kernel:code-jump-table-words
122 (sb-kernel:fun-code-header
#'typecase-jump-table
))
123 ;; 6 cases including NIL return, plus the size
126 (with-test (:name
:duplicates
)
127 (checked-compile-and-assert
130 (position c
"aaaaa"))
134 (with-test (:name
:array-subtype-dispatch-table
)
135 (assert (> (sb-kernel:code-jump-table-words
136 (sb-kernel:fun-code-header
#'sb-kernel
:vector-subseq
*))
139 (with-test (:name
:cleanups
)
140 (checked-compile-and-assert
142 `(lambda (b c
&optional f
)
147 (return-from b
(funcall f
11))
152 ((33 0 (lambda (x) (+ x
*))) 44)