Test the flonum-sqrt ucode primitive explicitly.
authorTaylor R Campbell <campbell@mumble.net>
Thu, 8 Nov 2018 07:47:20 +0000 (07:47 +0000)
committerTaylor R Campbell <campbell@mumble.net>
Thu, 8 Nov 2018 07:47:21 +0000 (07:47 +0000)
The compiler open-codes it in flo:sqrt on amd64, which hardware gives
the correct behaviour, but the ucode does not right now.

tests/microcode/test-flonum-except.scm

index 3b50532e2710f72fa21add8bba5ad2027f88b215..f3c5fb515780c320adefc2a08f954f04d4a98511 100644 (file)
@@ -177,6 +177,13 @@ USA.
 (define-invop-flag-test 'flonum-sqrt (applicator flo:sqrt -1.))        ;(g)
 (define-invop-trap-test 'flonum-sqrt (applicator flo:sqrt -1.))        ;(g)
 
+(define-invop-flag-test 'flonum-sqrt
+  (applicator (make-primitive-procedure 'flonum-sqrt) -1.)
+  'xerror)
+(define-invop-trap-test 'flonum-sqrt
+  (applicator (make-primitive-procedure 'flonum-sqrt) -1.)
+  'xerror)
+
 ;;; IEEE 754-2008, Sec. 7.3
 
 ;; XXX Check sign of infinity.