From 17807af213da9eb08507d47dff142a1f8672b4e7 Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Fri, 24 May 2019 15:00:34 +0200 Subject: [PATCH] add symbol-value --- src/comp.c | 5 ++++- test/src/comp-tests.el | 11 +++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/comp.c b/src/comp.c index 2e7ef4f077a..33528f98004 100644 --- a/src/comp.c +++ b/src/comp.c @@ -630,8 +630,11 @@ compile_f (const char *f_name, ptrdiff_t bytestr_length, break; case Bsymbol_value: - printf("Bsymbol_value\n"); + POP1; + res = jit_emit_call ("Fsymbol_value", comp.lisp_obj_type, 1, args); + PUSH (gcc_jit_lvalue_as_rvalue (res)); break; + case Bsymbol_function: printf("Bsymbol_function\n"); break; diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el index 769cd086b5a..36344d361fc 100644 --- a/test/src/comp-tests.el +++ b/test/src/comp-tests.el @@ -96,6 +96,17 @@ (should (= (comp-tests-aref-aset-f) 100))) +(ert-deftest comp-tests-symbol-value () + "Testing aref and aset." + (defvar comp-tests-var2 3) + (defun comp-tests-symbol-value-f () + (symbol-value 'comp-tests-var2)) + (byte-compile #'comp-tests-symbol-value-f) + (native-compile #'comp-tests-symbol-value-f) + + (should (= (comp-tests-symbol-value-f) 3))) + + (ert-deftest comp-tests-ffuncall () "Testing varset." (defun comp-tests-ffuncall-callee-f (x y z) -- 2.39.5