X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fcompiler-test-util.lisp;h=352db70625909a192a53ca3c4ebb383345ddd47e;hb=1fa1730414b6c914e502d339945d0ad7a4a7f5d9;hp=f0745d29a039010484b07b748acae250dcd47e67;hpb=ba0c7755846d3efe297d3b02b792381bc6c36515;p=sbcl.git diff --git a/tests/compiler-test-util.lisp b/tests/compiler-test-util.lisp index f0745d2..352db70 100644 --- a/tests/compiler-test-util.lisp +++ b/tests/compiler-test-util.lisp @@ -17,6 +17,7 @@ (:export #:assert-consing #:assert-no-consing #:compiler-derived-type + #:count-full-calls #:find-value-cell-values #:find-code-constants #:find-named-callees @@ -110,3 +111,16 @@ (values warn fail))) (ignore-errors (delete-file lisp)) (ignore-errors (delete-file fasl))))) + +;; Pretty horrible, but does the job +(defun count-full-calls (name function) + (let ((code (with-output-to-string (s) + (disassemble function :stream s))) + (n 0)) + (with-input-from-string (s code) + (loop for line = (read-line s nil nil) + while line + when (and (search name line) + (search "#