From 5a9d4d67043e86831df9c8b3dcb398c45b01bb06 Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Fri, 24 May 2019 14:01:45 +0200 Subject: [PATCH] add Blength --- src/comp.c | 4 +++- test/src/comp-tests.el | 9 +++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) 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) -- 2.39.5