From: Andrea Corallo Date: Fri, 24 May 2019 12:01:45 +0000 (+0200) Subject: add Blength X-Git-Tag: emacs-28.0.90~2727^2~1535 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5a9d4d67043e86831df9c8b3dcb398c45b01bb06;p=emacs.git add Blength --- diff --git a/src/comp.c b/src/comp.c index 657fb2630ed..198343c057c 100644 --- a/src/comp.c +++ b/src/comp.c @@ -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"); diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el index 313f6906cda..32d5b50e13d 100644 --- a/test/src/comp-tests.el +++ b/test/src/comp-tests.el @@ -76,6 +76,15 @@ (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)