]> git.eshelyaron.com Git - emacs.git/commitdiff
add Blength
authorAndrea Corallo <andrea_corallo@yahoo.it>
Fri, 24 May 2019 12:01:45 +0000 (14:01 +0200)
committerAndrea Corallo <akrl@sdf.org>
Wed, 1 Jan 2020 10:33:37 +0000 (11:33 +0100)
src/comp.c
test/src/comp-tests.el

index 657fb2630edf3263524b3b3e0bc9253802ab6409..198343c057cc3ae15a09c286009b8f844104c87a 100644 (file)
@@ -608,7 +608,9 @@ compile_f (const char *f_name, ptrdiff_t bytestr_length,
          }
 
        case Blength:
-         printf("Blength\n");
+         POP1;
+         res = jit_emit_call ("Flength", comp.lisp_obj_type, 1, args);
+         PUSH (gcc_jit_lvalue_as_rvalue (res));
          break;
        case Baref:
          printf("Baref\n");
index 313f6906cda1b7e56f24c121d4129d648cb274c0..32d5b50e13d96dd30b6fcbbb21e00e27f21c7496 100644 (file)
 
   (should (= comp-tests-var1 55)))
 
+(ert-deftest  comp-tests-length ()
+  "Testing length."
+  (defun comp-tests-length-f ()
+      (length '(1 2 3)))
+  (byte-compile #'comp-tests-length-f)
+  (native-compile #'comp-tests-length-f)
+
+  (should (= (comp-tests-length-f) 3)))
+
 (ert-deftest  comp-tests-ffuncall ()
   "Testing varset."
   (defun comp-tests-ffuncall-callee-f (x y z)