0.8.14.20: Documentation madness, yet again
[sbcl.git] / tests / compiler.pure.lisp
index 0799a59..1b48367 100644 (file)
                   (declare (type (integer 3 6) y)
                            (type (integer -6 -3) x))
                   (+ (logxor x y) most-positive-fixnum)))))
+
+;;; check that modular ash gives the right answer, to protect against
+;;; possible misunderstandings about the hardware shift instruction.
+(assert (zerop (funcall
+               (compile nil '(lambda (x y)
+                              (declare (optimize speed)
+                                       (type (unsigned-byte 32) x y))
+                              (logand #xffffffff (ash x y))))
+               1 257)))
+
+;;; code instrumenting problems
+(compile nil
+  '(lambda ()
+    (declare (optimize (debug 3)))
+    (list (the integer (if nil 14 t)))))
+
+(compile nil
+  '(LAMBDA (A B C D)
+    (DECLARE (NOTINLINE LOGORC1 BYTE MASK-FIELD))
+    (DECLARE
+     (OPTIMIZE (SPEED 1)
+      (SPACE 1)
+      (SAFETY 1)
+      (DEBUG 3)
+      (COMPILATION-SPEED 0)))
+    (MASK-FIELD (BYTE 7 26)
+     (PROGN
+       (TAGBODY (THE INTEGER (CATCH 'CT4 (LOGORC1 C -15950))) 1)
+       B))))