summaryrefslogtreecommitdiff
path: root/test/src/comp-tests.el
diff options
context:
space:
mode:
authorAndrea Corallo <akrl@sdf.org>2023-03-20 17:24:48 +0100
committerAndrea Corallo <akrl@sdf.org>2023-03-20 19:01:26 +0100
commit263d6c38539691c954f4c3057cbe8d5468499b91 (patch)
tree39277706b61b8450a79b0476537ba4791355a7eb /test/src/comp-tests.el
parent6bf441ff11540f2c49cb4f9d506597217cdc73d6 (diff)
downloademacs-263d6c38539691c954f4c3057cbe8d5468499b91.tar.gz
Comp fix calls to redefined primtives with op-bytecode (bug#61917)
* lisp/emacs-lisp/comp.el (comp-emit-set-call-subr): Fix compilation of calls to redefined primtives with dedicated op-bytecode. * test/src/comp-tests.el (61917-1): New test.
Diffstat (limited to 'test/src/comp-tests.el')
-rw-r--r--test/src/comp-tests.el13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el
index 926ba27e563..1615b2838fc 100644
--- a/test/src/comp-tests.el
+++ b/test/src/comp-tests.el
@@ -532,6 +532,19 @@ https://lists.gnu.org/archive/html/bug-gnu-emacs/2020-03/msg00914.html."
(should (subr-native-elisp-p
(symbol-function 'comp-test-48029-nonascii-žžž-f))))
+(comp-deftest 61917-1 ()
+ "Verify we can compile calls to redefined primitives with
+dedicated byte-op code."
+ (let ((f (lambda (fn &rest args)
+ (apply fn args))))
+ (advice-add #'delete-region :around f)
+ (unwind-protect
+ (should (subr-native-elisp-p
+ (native-compile
+ '(lambda ()
+ (delete-region (point-min) (point-max))))))
+ (advice-remove #'delete-region f))))
+
;;;;;;;;;;;;;;;;;;;;;
;; Tromey's tests. ;;