(declare (extended-bindings) (not constant-fold) (not safe))

(define a 0)
(define b 536870911)
(define c -536870912)
(define d 1)
(define e -1)
(define f 357913941)

(define (test-neg x)
  (println (##fxarithmetic-shift? x -1))
  (println (##fxarithmetic-shift? x -2))
  (println (##fxarithmetic-shift? x -10))
  (println (##fxarithmetic-shift? x -20))
  (println (##fxarithmetic-shift? x -29))
  (println (##fxarithmetic-shift? x -30)))

(define (test-pos x)
  (println (##fxarithmetic-shift? x 0))
  (println (##fxarithmetic-shift? x 1))
  (println (##fxarithmetic-shift? x 2))
  (println (##fxarithmetic-shift? x 10))
  (println (##fxarithmetic-shift? x 20))
  (println (##fxarithmetic-shift? x 29))
  (println (##fxarithmetic-shift? x 30)))

(define (test x)
  (test-pos x)
  (test-neg x))

(test a)
(test b)
(test c)
(test d)
(test e)
(test f)
