summaryrefslogtreecommitdiff
path: root/test/lisp/emacs-lisp
diff options
context:
space:
mode:
authorMattias EngdegÄrd <mattiase@acm.org>2020-02-21 12:16:20 +0100
committerMattias EngdegÄrd <mattiase@acm.org>2020-02-25 16:40:11 +0100
commit03c07c88d90b5747456b9d286bace2dd4a713aac (patch)
treebc5df98ed38273b010731c2c380b69758b237b56 /test/lisp/emacs-lisp
parent64af3c94a6197cd0c6a283880c900eeb5bf12961 (diff)
downloademacs-03c07c88d90b5747456b9d286bace2dd4a713aac.tar.gz
emacs-03c07c88d90b5747456b9d286bace2dd4a713aac.tar.bz2
emacs-03c07c88d90b5747456b9d286bace2dd4a713aac.zip
Generate 'substring' byte op (bug#39709)
The 'substring' byte op was not emitted, apparently by mistake. Fix. Suggested by Mark Oteiza <mvoteiza@udel.edu>. * lisp/emacs-lisp/bytecomp.el (byte-defop-compiler): Add '1-3' clause. (byte-compile-one-to-three-args): New. * lisp/emacs-lisp/byte-opt.el (byte-compile-side-effect-free-ops): Add 'byte-substring'. * test/lisp/emacs-lisp/bytecomp-tests.el (byte-opt-testsuite-arith-data): Test 'substring'.
Diffstat (limited to 'test/lisp/emacs-lisp')
-rw-r--r--test/lisp/emacs-lisp/bytecomp-tests.el7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el
index de11ae22d50..d4ceb47c36e 100644
--- a/test/lisp/emacs-lisp/bytecomp-tests.el
+++ b/test/lisp/emacs-lisp/bytecomp-tests.el
@@ -347,7 +347,12 @@
((eq x 't) 99)
(t 999))))
'((a c) (b c) (7 c) (-3 c) (nil nil) (t c) (q c) (r c) (s c)
- (t c) (x "a") (x "c") (x c) (x d) (x e))))
+ (t c) (x "a") (x "c") (x c) (x d) (x e)))
+
+ ;; `substring' bytecode generation (bug#39709).
+ (substring "abcdef")
+ (substring "abcdef" 2)
+ (substring "abcdef" 3 2))
"List of expression for test.
Each element will be executed by interpreter and with
bytecompiled code, and their results compared.")