aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrea Corallo2019-05-24 15:00:34 +0200
committerAndrea Corallo2020-01-01 11:33:38 +0100
commit17807af213da9eb08507d47dff142a1f8672b4e7 (patch)
tree120830e80ff65eab993490a5fcb041594968f582
parentbebd14acc1f646c79702fca4f7081df30a49a66c (diff)
downloademacs-17807af213da9eb08507d47dff142a1f8672b4e7.tar.gz
emacs-17807af213da9eb08507d47dff142a1f8672b4e7.zip
add symbol-value
-rw-r--r--src/comp.c5
-rw-r--r--test/src/comp-tests.el11
2 files changed, 15 insertions, 1 deletions
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,
630 break; 630 break;
631 631
632 case Bsymbol_value: 632 case Bsymbol_value:
633 printf("Bsymbol_value\n"); 633 POP1;
634 res = jit_emit_call ("Fsymbol_value", comp.lisp_obj_type, 1, args);
635 PUSH (gcc_jit_lvalue_as_rvalue (res));
634 break; 636 break;
637
635 case Bsymbol_function: 638 case Bsymbol_function:
636 printf("Bsymbol_function\n"); 639 printf("Bsymbol_function\n");
637 break; 640 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 @@
96 96
97 (should (= (comp-tests-aref-aset-f) 100))) 97 (should (= (comp-tests-aref-aset-f) 100)))
98 98
99(ert-deftest comp-tests-symbol-value ()
100 "Testing aref and aset."
101 (defvar comp-tests-var2 3)
102 (defun comp-tests-symbol-value-f ()
103 (symbol-value 'comp-tests-var2))
104 (byte-compile #'comp-tests-symbol-value-f)
105 (native-compile #'comp-tests-symbol-value-f)
106
107 (should (= (comp-tests-symbol-value-f) 3)))
108
109
99(ert-deftest comp-tests-ffuncall () 110(ert-deftest comp-tests-ffuncall ()
100 "Testing varset." 111 "Testing varset."
101 (defun comp-tests-ffuncall-callee-f (x y z) 112 (defun comp-tests-ffuncall-callee-f (x y z)