[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/native-comp e9c150b 5/7: * Add a test to verify form native comp
From: |
Andrea Corallo |
Subject: |
feature/native-comp e9c150b 5/7: * Add a test to verify form native compilation. |
Date: |
Wed, 14 Oct 2020 05:13:47 -0400 (EDT) |
branch: feature/native-comp
commit e9c150b5c2efee4fad0e41668f5bf1ecb9fad0df
Author: Andrea Corallo <akrl@sdf.org>
Commit: Andrea Corallo <akrl@sdf.org>
* Add a test to verify form native compilation.
* test/src/comp-tests.el (comp-deftest): Fix typo.
(compile-forms): New test.
---
test/src/comp-tests.el | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el
index 79bac3f..a13235b 100644
--- a/test/src/comp-tests.el
+++ b/test/src/comp-tests.el
@@ -46,7 +46,7 @@
"Define a test for the native compiler tagging it as :nativecomp."
(declare (indent defun)
(doc-string 3))
- `(ert-deftest ,(intern (concat "compt-tests-" (symbol-name name))) ,args
+ `(ert-deftest ,(intern (concat "comp-tests-" (symbol-name name))) ,args
:tags '(:nativecomp)
,@docstring-and-body))
@@ -409,6 +409,17 @@
https://lists.gnu.org/archive/html/bug-gnu-emacs/2020-03/msg00914.html."
(should (eq (comp-test-primitive-redefine-f 10 2) 'xxx))
(should (equal comp-test-primitive-redefine-args '(10 2)))))
+(comp-deftest compile-forms ()
+ "Verify lambda form native compilation."
+ (should-error (native-compile '(+ 1 foo)))
+ (let ((f (native-compile '(lambda (x) (1+ x)))))
+ (should (subr-native-elisp-p f))
+ (should (= (funcall f 2) 3)))
+ (let* ((lexical-binding nil)
+ (f (native-compile '(lambda (x) (1+ x)))))
+ (should (subr-native-elisp-p f))
+ (should (= (funcall f 2) 3))))
+
;;;;;;;;;;;;;;;;;;;;;
;; Tromey's tests. ;;
- feature/native-comp updated (237fd33 -> f8505fd), Andrea Corallo, 2020/10/14
- feature/native-comp 4bea0c0 2/7: * Allow for lambda forms as native compilation input, Andrea Corallo, 2020/10/14
- feature/native-comp fda7988 1/7: * Move context output computation in `comp-spill-lap-function', Andrea Corallo, 2020/10/14
- feature/native-comp 4f0e879 4/7: Rework `native-compile' interface so it can return compiled functions, Andrea Corallo, 2020/10/14
- feature/native-comp e9c150b 5/7: * Add a test to verify form native compilation.,
Andrea Corallo <=
- feature/native-comp 03e98f9 6/7: Use form native compilation in `comp-trampoline-compile', Andrea Corallo, 2020/10/14
- feature/native-comp 8861ee8 3/7: Have `native-elisp-load' return the last registerd function, Andrea Corallo, 2020/10/14
- feature/native-comp f8505fd 7/7: Merge remote-tracking branch 'savannah/master' into HEAD, Andrea Corallo, 2020/10/14