Fix make-array transforms.
[sbcl.git] / tests / profile.impure.lisp
index ab1c95c..95e4b7f 100644 (file)
@@ -80,7 +80,7 @@
 
 (in-package :cl-user)
 
-(with-test (:name (profile threads))
+(with-test (:name (profile :threads))
   (profile "PROFILE-TEST")
   ;; This used to signal an error with threads
   (let* ((n #+sb-thread 5 #-sb-thread 1)
     (unless (equal res want)
       (error "wanted ~S, got ~S" want res)))
   (report))
+
+(with-test (:name :profiling-counter)
+  ;; Make sure our profiling counters don't miscount
+  (let ((c (sb-profile::make-counter))
+        (i 0))
+    (loop repeat 1000000
+          do (let ((n (random (* 12 (ash 1 sb-vm:n-word-bits)))))
+               (sb-profile::incf-counter c n)
+               (incf i n))
+             (let ((n (random (ash 1 sb-vm:n-word-bits))))
+               (sb-profile::incf-counter c n)
+               (incf i n)))
+    (assert (= i (sb-profile::counter-count c)))))