diff options
| author | Andrea Corallo | 2020-10-12 22:34:57 +0200 |
|---|---|---|
| committer | Andrea Corallo | 2020-10-14 11:04:36 +0200 |
| commit | 4f0e87903095da1225830e27ef27e61ba9ff08af (patch) | |
| tree | bcda9b34f6f4c4283e49861c728d9ec013a6ef35 /test/src | |
| parent | 8861ee8b087b4e5d9ac9186a2c2d8e44b07fc186 (diff) | |
| download | emacs-4f0e87903095da1225830e27ef27e61ba9ff08af.tar.gz emacs-4f0e87903095da1225830e27ef27e61ba9ff08af.zip | |
Rework `native-compile' interface so it can return compiled functions
* lisp/emacs-lisp/comp.el (native-compile): Return the compiled
function when the input is a symbol or a form.
* test/src/comp-tests.el (free-fun, tco, fw-prop): Update tests
for new `native-compile' interface.
Diffstat (limited to 'test/src')
| -rw-r--r-- | test/src/comp-tests.el | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el index 317a6113af2..79bac3f711f 100644 --- a/test/src/comp-tests.el +++ b/test/src/comp-tests.el | |||
| @@ -359,7 +359,7 @@ Check that the resulting binaries do not differ." | |||
| 359 | (interactive) | 359 | (interactive) |
| 360 | 3) | 360 | 3) |
| 361 | t) | 361 | t) |
| 362 | (load (native-compile #'comp-tests-free-fun-f)) | 362 | (native-compile #'comp-tests-free-fun-f) |
| 363 | 363 | ||
| 364 | (should (subr-native-elisp-p (symbol-function #'comp-tests-free-fun-f))) | 364 | (should (subr-native-elisp-p (symbol-function #'comp-tests-free-fun-f))) |
| 365 | (should (= (comp-tests-free-fun-f) 3)) | 365 | (should (= (comp-tests-free-fun-f) 3)) |
| @@ -692,7 +692,7 @@ CHECKER should always return nil to have a pass." | |||
| 692 | b | 692 | b |
| 693 | (comp-tests-tco-f (+ a b) a (- count 1)))) | 693 | (comp-tests-tco-f (+ a b) a (- count 1)))) |
| 694 | t) | 694 | t) |
| 695 | (load (native-compile #'comp-tests-tco-f)) | 695 | (native-compile #'comp-tests-tco-f) |
| 696 | (should (subr-native-elisp-p (symbol-function #'comp-tests-tco-f))) | 696 | (should (subr-native-elisp-p (symbol-function #'comp-tests-tco-f))) |
| 697 | (should (= (comp-tests-tco-f 1 0 10) 55)))) | 697 | (should (= (comp-tests-tco-f 1 0 10) 55)))) |
| 698 | 698 | ||
| @@ -714,7 +714,7 @@ CHECKER should always return nil to have a pass." | |||
| 714 | (c (concat a b))) ; <= has to optimize | 714 | (c (concat a b))) ; <= has to optimize |
| 715 | (length c))) ; <= has to optimize | 715 | (length c))) ; <= has to optimize |
| 716 | t) | 716 | t) |
| 717 | (load (native-compile #'comp-tests-fw-prop-1-f)) | 717 | (native-compile #'comp-tests-fw-prop-1-f) |
| 718 | (should (subr-native-elisp-p (symbol-function #'comp-tests-fw-prop-1-f))) | 718 | (should (subr-native-elisp-p (symbol-function #'comp-tests-fw-prop-1-f))) |
| 719 | (should (= (comp-tests-fw-prop-1-f) 6)))) | 719 | (should (= (comp-tests-fw-prop-1-f) 6)))) |
| 720 | 720 | ||