]> git.eshelyaron.com Git - emacs.git/commitdiff
add comp-tests-free-fun
authorAndrea Corallo <akrl@sdf.org>
Sun, 24 Nov 2019 15:03:01 +0000 (16:03 +0100)
committerAndrea Corallo <akrl@sdf.org>
Wed, 1 Jan 2020 10:38:09 +0000 (11:38 +0100)
test/src/comp-tests.el

index 361f116edaec1672e975dd8993c0fe7c9622001d..570dcbd1ffa3ae9124f7c4b65658d25a47ce3047 100644 (file)
@@ -30,7 +30,7 @@
 (require 'comp)
 
 ;; (setq comp-debug 1)
-(setq comp-speed 3)
+(setq comp-speed 0)
 
 (defconst comp-test-directory (file-name-directory (or load-file-name
                                                        buffer-file-name)))
@@ -307,6 +307,14 @@ Check that the resulting binaries do not differ."
   ;; See `comp-propagate-insn' `comp-function-call-remove'.
   (should (= (comp-tests-func-call-removal-f) 1)))
 
+(ert-deftest comp-tests-free-fun ()
+  "Check we are able to compile a single function."
+  (defun comp-tests-free-fun-f ()
+    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)))
+
 \f
 ;;;;;;;;;;;;;;;;;;;;
 ;; Tromey's tests ;;