From 5b8b2982830028303d207d111095e35c90ae6805 Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Sun, 28 Jun 2020 13:45:49 +0100 Subject: [PATCH] Add a test to verify CL macro expansion in dynamic scope * test/src/comp-tests.el (comp-tests-cl-macro-exp): New test. * test/src/comp-test-funcs-dyn.el: Require `cl-lib'. (comp-tests-cl-macro-exp-f): New function. --- test/src/comp-test-funcs-dyn.el | 7 +++++++ test/src/comp-tests.el | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/test/src/comp-test-funcs-dyn.el b/test/src/comp-test-funcs-dyn.el index 0e342a39d3e..50a72807be7 100644 --- a/test/src/comp-test-funcs-dyn.el +++ b/test/src/comp-test-funcs-dyn.el @@ -23,6 +23,8 @@ ;;; Code: +(require 'cl-lib) + (defun comp-tests-ffuncall-callee-dyn-f (a b) (list a b)) @@ -35,6 +37,11 @@ (defun comp-tests-ffuncall-callee-opt-rest-dyn-f (a b &optional c &rest d) (list a b c d)) +(defun comp-tests-cl-macro-exp-f () + (cl-loop for xxx in '(a b) + for yyy = xxx + collect xxx)) + (provide 'comp-test-dyn-funcs) ;;; comp-test-funcs-dyn.el ends here diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el index 51586d2f9e8..fe818960dd2 100644 --- a/test/src/comp-tests.el +++ b/test/src/comp-tests.el @@ -574,4 +574,8 @@ https://lists.gnu.org/archive/html/bug-gnu-emacs/2020-03/msg00914.html." (should (equal '(2 . many) (func-arity #'comp-tests-ffuncall-callee-opt-rest-dyn-f)))) +(ert-deftest comp-tests-cl-macro-exp () + "Verify CL macro expansion (bug#42088)." + (should (equal (comp-tests-cl-macro-exp-f) '(a b)))) + ;;; comp-tests.el ends here -- 2.39.5