mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-01-11 16:08:13 +00:00
single function native compilation doc + interactive support + tests
This commit is contained in:
parent
b3db331e8c
commit
6c9acd13d0
@ -420,7 +420,9 @@ Put PREFIX in front of it."
|
||||
"Byte compile FUNCTION-NAME spilling data from the byte compiler."
|
||||
(let* ((f (symbol-function function-name))
|
||||
(func (make-comp-func :name function-name
|
||||
:c-name (comp-c-func-name function-name"F"))))
|
||||
:c-name (comp-c-func-name function-name"F")
|
||||
:doc (documentation f)
|
||||
:int-spec (interactive-form f))))
|
||||
(when (byte-code-function-p f)
|
||||
(signal 'native-compiler-error
|
||||
"can't native compile an already bytecompiled function"))
|
||||
|
@ -328,10 +328,18 @@ Check that the resulting binaries do not differ."
|
||||
(ert-deftest comp-tests-free-fun ()
|
||||
"Check we are able to compile a single function."
|
||||
(defun comp-tests-free-fun-f ()
|
||||
"Some doc."
|
||||
(interactive)
|
||||
3)
|
||||
(load (native-compile #'comp-tests-free-fun-f))
|
||||
|
||||
(should (subr-native-elisp-p (symbol-function #'comp-tests-free-fun-f)))
|
||||
(should (= (comp-tests-free-fun-f) 3)))
|
||||
(should (= (comp-tests-free-fun-f) 3))
|
||||
(should (string= (documentation #'comp-tests-free-fun-f)
|
||||
"Some doc."))
|
||||
(should (commandp #'comp-tests-free-fun-f))
|
||||
(should (equal (interactive-form #'comp-tests-free-fun-f)
|
||||
'(interactive))))
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;
|
||||
|
Loading…
Reference in New Issue
Block a user