summaryrefslogtreecommitdiff
path: root/test/lisp/emacs-lisp/bytecomp-tests.el
diff options
context:
space:
mode:
authorPaul Eggert <eggert@Penguin.CS.UCLA.EDU>2018-06-16 07:44:58 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2018-06-16 09:44:05 -0700
commite1284341fdc9a5d9b25339c3d47b02bc35cd8db4 (patch)
treef15a3b9382d6cf1c54a61eff801254a0ba3e2b0c /test/lisp/emacs-lisp/bytecomp-tests.el
parent4753d79331f747001ebdbbe9c32b33597daab37f (diff)
downloademacs-e1284341fdc9a5d9b25339c3d47b02bc35cd8db4.tar.gz
Fix byte compilation of (eq foo 'default)
Backport from master. Do not use the symbol ‘default’ as a special marker. Instead, use a value that cannot appear in the program, improving on a patch proposed by Robert Cochran (Bug#31718#14). * lisp/emacs-lisp/bytecomp.el (byte-compile--default-val): New constant. (byte-compile-cond-jump-table-info) (byte-compile-cond-jump-table): Use it instead of 'default. * test/lisp/emacs-lisp/bytecomp-tests.el: (byte-opt-testsuite-arith-data): Add a test for the bug.
Diffstat (limited to 'test/lisp/emacs-lisp/bytecomp-tests.el')
-rw-r--r--test/lisp/emacs-lisp/bytecomp-tests.el9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el
index 13df5912eef..f93c3bdc40f 100644
--- a/test/lisp/emacs-lisp/bytecomp-tests.el
+++ b/test/lisp/emacs-lisp/bytecomp-tests.el
@@ -286,7 +286,14 @@
(t)))
(let ((a))
(cond ((eq a 'foo) 'incorrect)
- ('correct))))
+ ('correct)))
+ ;; Bug#31734
+ (let ((variable 0))
+ (cond
+ ((eq variable 'default)
+ (message "equal"))
+ (t
+ (message "not equal")))))
"List of expression for test.
Each element will be executed by interpreter and with
bytecompiled code, and their results compared.")