master: Fix a test for :interpreter

stassats via Sbcl-commits <[email protected]> Thu, 30 Jul 2026 02:54:00 +0000
Newsgroups gmane.lisp.steel-bank.cvs
Message-ID <[email protected]>
The branch "master" has been updated in SBCL:
       via  ff3913b27709be207ee201b872c3636ec23b7feb (commit)
      from  a56065fe38daa5f68d77c7db33263b874411c3a3 (commit)

- Log -----------------------------------------------------------------
commit ff3913b27709be207ee201b872c3636ec23b7feb
Author: Stas Boukarev <[email protected]>
Date:   Thu Jul 30 01:02:18 2026 +0300

    Fix a test for :interpreter
---
 tests/jump-table.pure.lisp | 42 ++++++++++++++++++++++--------------------
 1 file changed, 22 insertions(+), 20 deletions(-)

diff --git a/tests/jump-table.pure.lisp b/tests/jump-table.pure.lisp
index c56632499..4a8d65779 100644
--- a/tests/jump-table.pure.lisp
+++ b/tests/jump-table.pure.lisp
@@ -197,24 +197,26 @@
         standard-char)
        p1))))
 
-(defun good-example (x y)
-  (declare (fixnum x))
-  (let ((bits (logand x 7)))
-    (case bits
-      (0 (print 'foo))
-      (1 (cons 'a y))
-      (2 (cons y 'zook))
-      (3 "hi"))))
-
-(defun failing-example (x y)
-  (declare (fixnum x))
-  (let ((bits (logand x 3)))
-    (case bits
-      (0 (print 'foo))
-      (1 (cons 'a y))
-      (2 (cons y 'zook))
-      (3 "hi"))))
-
 (with-test (:name :should-use-jump-table)
-  (assert (= (sb-kernel:code-jump-table-words (sb-kernel:fun-code-header #'good-example)) 5))
-  (assert (= (sb-kernel:code-jump-table-words (sb-kernel:fun-code-header #'failing-example)) 5)))
+  (assert (= (sb-kernel:code-jump-table-words
+              (sb-kernel:fun-code-header
+               (checked-compile `(lambda (x y)
+                                   (declare (fixnum x))
+                                   (let ((bits (logand x 7)))
+                                     (case bits
+                                       (0 (print 'foo))
+                                       (1 (cons 'a y))
+                                       (2 (cons y 'zook))
+                                       (3 "hi")))))))
+             5))
+  (assert (= (sb-kernel:code-jump-table-words
+              (sb-kernel:fun-code-header
+               (checked-compile `(lambda (x y)
+                                   (declare (fixnum x))
+                                   (let ((bits (logand x 3)))
+                                     (case bits
+                                       (0 (print 'foo))
+                                       (1 (cons 'a y))
+                                       (2 (cons y 'zook))
+                                       (3 "hi")))))))
+             5)))

-----------------------------------------------------------------------


hooks/post-receive
-- 
SBCL