From 560e95e2c4e53b4434dc44543cecc1378a5270b9 Mon Sep 17 00:00:00 2001 From: Mark Evenson Date: Sat, 15 Jul 2023 08:00:44 +0200 Subject: [PATCH 1/2] Test for compiler problems with LABELS and INLINE declaration From . --- t/compiler-inline.lisp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 t/compiler-inline.lisp diff --git a/t/compiler-inline.lisp b/t/compiler-inline.lisp new file mode 100644 index 000000000..774e76afe --- /dev/null +++ b/t/compiler-inline.lisp @@ -0,0 +1,21 @@ +;;;; +(unless (ignore-errors (asdf:load-system :fset)) + (ql:quickload :fset)) + +(in-package :fset-user) +(defun foo (x) + (labels ((bar (x) + (cond ((null x) nil) + ((eq (car x) '&rest) (tail (cadr x))) + (t (cons (car x) (bar (cdr x)))))) + (tail (x) + (list 'local-tail x))) + (bar x))) +(compile 'foo) + +(prove:plan 1) +(prove:is + (foo '(a &rest b)) + '(a local-tail b)) +(prove:finalize) + From 8df47c02ee3ad808ccd241e936c679e431045ebc Mon Sep 17 00:00:00 2001 From: Mark Evenson Date: Sat, 15 Jul 2023 08:50:23 +0200 Subject: [PATCH 2/2] Improve test verifying it succeeds in SBCL and ECL Be more careful about packages --- t/compiler-inline.lisp | 17 +++++------------ t/eg/inline-labels.lisp | 9 +++++++++ 2 files changed, 14 insertions(+), 12 deletions(-) create mode 100644 t/eg/inline-labels.lisp diff --git a/t/compiler-inline.lisp b/t/compiler-inline.lisp index 774e76afe..ce81a821d 100644 --- a/t/compiler-inline.lisp +++ b/t/compiler-inline.lisp @@ -2,20 +2,13 @@ (unless (ignore-errors (asdf:load-system :fset)) (ql:quickload :fset)) -(in-package :fset-user) -(defun foo (x) - (labels ((bar (x) - (cond ((null x) nil) - ((eq (car x) '&rest) (tail (cadr x))) - (t (cons (car x) (bar (cdr x)))))) - (tail (x) - (list 'local-tail x))) - (bar x))) -(compile 'foo) +(load + (compile-file + (asdf:system-relative-pathname :abcl "t/eg/inline-labels.lisp"))) (prove:plan 1) (prove:is - (foo '(a &rest b)) - '(a local-tail b)) + (fset-user::foo '(a &rest b)) + '(a fset-user::local-tail b)) (prove:finalize) diff --git a/t/eg/inline-labels.lisp b/t/eg/inline-labels.lisp new file mode 100644 index 000000000..55b3a21e9 --- /dev/null +++ b/t/eg/inline-labels.lisp @@ -0,0 +1,9 @@ +(in-package :fset-user) +(defun foo (x) + (labels ((bar (x) + (cond ((null x) nil) + ((eq (car x) '&rest) (tail (cadr x))) + (t (cons (car x) (bar (cdr x)))))) + (tail (x) + (list 'local-tail x))) + (bar x)))