summaryrefslogtreecommitdiff
path: root/test/lisp/emacs-lisp/bytecomp-tests.el
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2021-12-02 09:21:11 +0800
committerPo Lu <luangruo@yahoo.com>2021-12-02 09:21:11 +0800
commit78a3933b62c1c83a6a4d54c9bc65faf069aa83dc (patch)
treeb138ef00b5f0e66e5289773ecb6abc560dd4f97f /test/lisp/emacs-lisp/bytecomp-tests.el
parent6e5c2fb468de23649c6df8710ec483e712894d8f (diff)
parent01a6c0b409c4d9ad92c4bb99bdb06c742bf3b0dd (diff)
downloademacs-78a3933b62c1c83a6a4d54c9bc65faf069aa83dc.tar.gz
emacs-78a3933b62c1c83a6a4d54c9bc65faf069aa83dc.tar.bz2
emacs-78a3933b62c1c83a6a4d54c9bc65faf069aa83dc.zip
Merge remote-tracking branch 'origin/master' into feature/pgtk
Diffstat (limited to 'test/lisp/emacs-lisp/bytecomp-tests.el')
-rw-r--r--test/lisp/emacs-lisp/bytecomp-tests.el43
1 files changed, 43 insertions, 0 deletions
diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el
index 816f14a18d5..b82afd353cf 100644
--- a/test/lisp/emacs-lisp/bytecomp-tests.el
+++ b/test/lisp/emacs-lisp/bytecomp-tests.el
@@ -643,6 +643,49 @@ inner loops respectively."
(cond)
(mapcar (lambda (x) (cond ((= x 0)))) '(0 1))
+
+ ;; These expressions give different results in lexbind and dynbind modes,
+ ;; but in each the compiler and interpreter should agree!
+ ;; (They look much the same but come in pairs exercising both the
+ ;; `let' and `let*' paths.)
+ (let ((f (lambda (x)
+ (lambda ()
+ (let ((g (lambda () x)))
+ (let ((x 'a))
+ (list x (funcall g))))))))
+ (funcall (funcall f 'b)))
+ (let ((f (lambda (x)
+ (lambda ()
+ (let ((g (lambda () x)))
+ (let* ((x 'a))
+ (list x (funcall g))))))))
+ (funcall (funcall f 'b)))
+ (let ((f (lambda (x)
+ (lambda ()
+ (let ((g (lambda () x)))
+ (setq x (list x x))
+ (let ((x 'a))
+ (list x (funcall g))))))))
+ (funcall (funcall f 'b)))
+ (let ((f (lambda (x)
+ (lambda ()
+ (let ((g (lambda () x)))
+ (setq x (list x x))
+ (let* ((x 'a))
+ (list x (funcall g))))))))
+ (funcall (funcall f 'b)))
+ (let ((f (lambda (x)
+ (let ((g (lambda () x))
+ (h (lambda () (setq x (list x x)))))
+ (let ((x 'a))
+ (list x (funcall g) (funcall h)))))))
+ (funcall (funcall f 'b)))
+ (let ((f (lambda (x)
+ (let ((g (lambda () x))
+ (h (lambda () (setq x (list x x)))))
+ (let* ((x 'a))
+ (list x (funcall g) (funcall h)))))))
+ (funcall (funcall f 'b)))
)
"List of expressions for cross-testing interpreted and compiled code.")