Ticket #894: longlong-test.lisp

File longlong-test.lisp, 853 bytes (added by ivan4th, 2 years ago)

Test case

Line 
1(in-package :cl-user)
2
3(defun testit ()
4  (%stack-block ((x 8))
5    (ccl::%%set-unsigned-longlong x 0 (ash 1 63))
6    (assert (= (ash 1 63) (ccl::%get-unsigned-long-long x 0)))
7    (ccl::%%set-signed-longlong x 0 (1- (ash 1 63)))
8    (assert (= (1- (ash 1 63)) (ccl::%get-signed-long-long x 0)))
9    (ccl::%%set-unsigned-longlong x 0 (ash 1 30))
10    (assert (= (ash 1 30) (ccl::%get-unsigned-long-long x 0)))
11    (ccl::%%set-signed-longlong x 0 (ash 1 30))
12    (assert (= (ash 1 30) (ccl::%get-signed-long-long x 0)))
13    (ccl::%%set-signed-longlong x 0 (ash -1 30))
14    (assert (= (ash -1 30) (ccl::%get-signed-long-long x 0)))
15    (ccl::%%set-signed-longlong x 0 (ash -1 29))
16    (assert (= (ash -1 29) (ccl::%get-signed-long-long x 0)))
17    (ccl::%%set-signed-longlong x 0 (ash -1 62))
18    (assert (= (ash -1 62) (ccl::%get-signed-long-long x 0)))))