From 25d1b0d9d3fb4cb6171e0a935e4fe8aca08c9087 Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Thu, 30 May 2019 05:29:56 +0000 Subject: [PATCH] Expect some failures to signal errors on fp exception traps on arm64. --- tests/runtime/test-arith.scm | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/tests/runtime/test-arith.scm b/tests/runtime/test-arith.scm index 4c1763f64..3f9cc35c6 100644 --- a/tests/runtime/test-arith.scm +++ b/tests/runtime/test-arith.scm @@ -77,6 +77,11 @@ USA. (define assert-inexact (predicate-assertion inexact? "inexact")) +(define (assert-flo-error procedure) + (if (flo:have-trap-enable/disable?) + (assert-error procedure) + (expect-failure (lambda () (assert-error procedure))))) + (define (assert-no-except/yes-traps procedure) (assert-eqv (flo:preserving-environment @@ -836,7 +841,7 @@ USA. (let ((x (identity-procedure (flo:snan 4321))) (x* (flo:qnan 4321))) (assert-eqv-nan (no-traps (lambda () (sqrt x))) x*) - (assert-error (lambda () (yes-traps (lambda () (sqrt x))))) + (assert-flo-error (lambda () (yes-traps (lambda () (sqrt x))))) (assert-only-except/no-traps (flo:exception:invalid-operation) (lambda () (sqrt x))) (let ((x+0i (make-rectangular x +0.)) @@ -847,10 +852,10 @@ USA. (assert-eqv-nan (no-traps (lambda () (real-part (sqrt x-0i)))) x*) (assert-eqv-nan (no-traps (lambda () (real-part (sqrt xi+0)))) x*) (assert-eqv-nan (no-traps (lambda () (real-part (sqrt xi-0)))) x*) - (assert-error (lambda () (yes-traps (lambda () (sqrt x+0i))))) - (assert-error (lambda () (yes-traps (lambda () (sqrt x-0i))))) - (assert-error (lambda () (yes-traps (lambda () (sqrt xi+0))))) - (assert-error (lambda () (yes-traps (lambda () (sqrt xi-0))))) + (assert-flo-error (lambda () (yes-traps (lambda () (sqrt x+0i))))) + (assert-flo-error (lambda () (yes-traps (lambda () (sqrt x-0i))))) + (assert-flo-error (lambda () (yes-traps (lambda () (sqrt xi+0))))) + (assert-flo-error (lambda () (yes-traps (lambda () (sqrt xi-0))))) (assert-only-except/no-traps (flo:exception:invalid-operation) (lambda () (sqrt x+0i))) (assert-only-except/no-traps (flo:exception:invalid-operation) @@ -1031,7 +1036,7 @@ USA. (lambda () (if (infinite? y) (begin - (assert-error + (assert-flo-error (lambda () (yes-traps (lambda () (exact->inexact x))))) (assert-except/no-traps (flo:exception:overflow) -- 2.25.1