(should (native-comp-function-p (symbol-function 'comp-tests-pure-fibn-entry-f)))
(should (= (comp-tests-pure-fibn-entry-f) 6765))))
-(defvar comp-tests-cond-rw-checked-function nil
- "Function to be checked.")
-(defun comp-tests-cond-rw-checker-val (_)
- "Check we manage to propagate the correct return value."
- (should
- (cl-some
- #'identity
- (comp-tests-map-checker
- comp-tests-cond-rw-checked-function
- (lambda (insn)
- (pcase insn
- (`(return ,mvar)
- (and (comp-cstr-imm-vld-p mvar)
- (eql (comp-cstr-imm mvar) 123)))))))))
-
-(defvar comp-tests-cond-rw-expected-type nil
- "Type to expect in `comp-tests-cond-rw-checker-type'.")
-(defun comp-tests-cond-rw-checker-type (_)
- "Check we manage to propagate the correct return type."
- (should
- (cl-some
- #'identity
- (comp-tests-map-checker
- comp-tests-cond-rw-checked-function
- (lambda (insn)
- (pcase insn
- (`(return ,mvar)
- (equal (comp-mvar-typeset mvar)
- comp-tests-cond-rw-expected-type))))))))
-
(comp-deftest comp-tests-result-lambda ()
(native-compile 'comp-tests-result-lambda)
(should (eq (funcall (comp-tests-result-lambda) '(a . b)) 'a)))