]> git.eshelyaron.com Git - emacs.git/commitdiff
add symbol-value
authorAndrea Corallo <andrea_corallo@yahoo.it>
Fri, 24 May 2019 13:00:34 +0000 (15:00 +0200)
committerAndrea Corallo <akrl@sdf.org>
Wed, 1 Jan 2020 10:33:38 +0000 (11:33 +0100)
src/comp.c
test/src/comp-tests.el

index 2e7ef4f077aed0d32b77c189383c7923d7390a01..33528f98004e67b0ea3321171bb6d96c34c461c8 100644 (file)
@@ -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;
index 769cd086b5aecca857ef3cc3eb4c8c41e0110346..36344d361fc04e1f9942e671a7fcb3dfcb83a86b 100644 (file)
 
   (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)