+(with-test (:name :atomic-incf-wraparound)
+ (let ((box (make-box :word (1- (ash 1 sb-vm:n-word-bits)))))
+ (sb-ext:atomic-incf (box-word box) 2)
+ (assert (= 1 (box-word box)))))
+
+(with-test (:name :atomic-decf-wraparound)
+ (let ((box (make-box :word 0)))
+ (sb-ext:atomic-decf (box-word box) 2)
+ (assert (= (- (ash 1 sb-vm:n-word-bits) 2) (box-word box)))))
+