From 34117dea7736012114e5c20fcf9f328e0658f8b3 Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Mon, 15 Jun 2020 21:27:00 +0200 Subject: [PATCH] Add a test for speed -1 * test/src/comp-tests.el (comp-test-speed--1): New test * test/src/comp-test-funcs.el (comp-test-speed--1-f): New function. --- test/src/comp-test-funcs.el | 4 ++++ test/src/comp-tests.el | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/test/src/comp-test-funcs.el b/test/src/comp-test-funcs.el index 5e04be4459f..168819b17d6 100644 --- a/test/src/comp-test-funcs.el +++ b/test/src/comp-test-funcs.el @@ -286,6 +286,10 @@ (defun comp-test-40187-2-f () 'bar) +(defun comp-test-speed--1-f () + (declare (speed -1)) + 3) + ;;;;;;;;;;;;;;;;;;;; ;; Tromey's tests ;; diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el index ee96d5656e7..d6fff8233c0 100644 --- a/test/src/comp-tests.el +++ b/test/src/comp-tests.el @@ -358,6 +358,11 @@ https://lists.gnu.org/archive/html/bug-gnu-emacs/2020-03/msg00914.html." (should (eq (comp-test-40187-1-f) 'foo)) (should (eq (comp-test-40187-2-f) 'bar))) +(ert-deftest comp-test-speed--1 () + "Check that at speed -1 we do not native compile." + (should (= (comp-test-speed--1-f) 3)) + (should-not (subr-native-elisp-p (symbol-function #'comp-test-speed--1-f)))) + ;;;;;;;;;;;;;;;;;;;;; ;; Tromey's tests. ;; -- 2.39.5