Test that compiler hints are executed transparently.
* test/src/comp-tests.el (comp-tests-type-hints): New test.
* test/src/comp-test-funcs.el (comp-tests-hint-fixnum-f)
(comp-tests-hint-cons-f): New functions.
(defun comp-tests-cons-cdr-f (x)
(cdr (cons 'foo x)))
+(defun comp-tests-hint-fixnum-f (n)
+ (1+ (comp-hint-fixnum n)))
+
+(defun comp-tests-hint-cons-f (c)
+ (car (comp-hint-cons c)))
+
(defun comp-tests-varset0-f ()
(setq comp-tests-var1 55))
(defun comp-tests-varset1-f ()
(should-error (comp-tests-fixnum-minus-f 'a)
:type 'wrong-type-argument))
+(ert-deftest comp-tests-type-hints ()
+ "Just test compiler hints are transparent in this case."
+ ;; FIXME we should really check they are also effective.
+ (should (= (comp-tests-hint-fixnum-f 3) 4))
+ (should (= (comp-tests-hint-cons-f (cons 1 2)) 1)))
+
(ert-deftest comp-tests-arith-comp ()
"Testing arithmetic comparisons."
(should (eq (comp-tests-eqlsign-f 4 3) nil))