summaryrefslogtreecommitdiff
path: root/test/lisp/emacs-lisp
diff options
context:
space:
mode:
authorMattias EngdegÄrd <mattiase@acm.org>2021-11-02 14:48:55 +0100
committerMattias EngdegÄrd <mattiase@acm.org>2021-11-02 22:46:20 +0100
commit493fde95bed6c65e049b8e664837397546847b37 (patch)
tree1ec80cf28953b9ff84116f2e55c78b55add185e2 /test/lisp/emacs-lisp
parent11702a6dd7cb8286f28b7cb986057d2d2c66a914 (diff)
downloademacs-493fde95bed6c65e049b8e664837397546847b37.tar.gz
emacs-493fde95bed6c65e049b8e664837397546847b37.tar.bz2
emacs-493fde95bed6c65e049b8e664837397546847b37.zip
Optimise (cond) => nil at source level
* lisp/emacs-lisp/byte-opt.el (byte-optimize-cond): Optimise clause-free `cond`, which can arise from earlier transformations. This enables further optimisations. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases): Add test cases.
Diffstat (limited to 'test/lisp/emacs-lisp')
-rw-r--r--test/lisp/emacs-lisp/bytecomp-tests.el3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el
index a6e224b3d2c..41edc1f8289 100644
--- a/test/lisp/emacs-lisp/bytecomp-tests.el
+++ b/test/lisp/emacs-lisp/bytecomp-tests.el
@@ -640,6 +640,9 @@ inner loops respectively."
(f (list (lambda (x) (setq a x)))))
(funcall (car f) 3)
(list a b))
+
+ (cond)
+ (mapcar (lambda (x) (cond ((= x 0)))) '(0 1))
)
"List of expressions for cross-testing interpreted and compiled code.")