diff options
Diffstat (limited to 'pl/math/test/pl_test.h')
-rw-r--r-- | pl/math/test/pl_test.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/pl/math/test/pl_test.h b/pl/math/test/pl_test.h index d4901b1..66dc73a 100644 --- a/pl/math/test/pl_test.h +++ b/pl/math/test/pl_test.h @@ -6,9 +6,24 @@ * SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception. */ -/* Emit the max ULP threshold, l, for routine f. */ +/* Emit the max ULP threshold, l, for routine f. Piggy-back PL_TEST_EXPECT_FENV + on PL_TEST_ULP to add EXPECT_FENV to all scalar routines. */ +#if !(V_SUPPORTED || SV_SUPPORTED) +#define PL_TEST_ULP(f, l) \ + PL_TEST_EXPECT_FENV (f, 1) \ + PL_TEST_ULP f l +#else #define PL_TEST_ULP(f, l) PL_TEST_ULP f l +#endif /* Emit aliases to allow test params to be mapped from aliases back to their aliasees. */ #define PL_ALIAS(a, b) PL_TEST_ALIAS a b + +/* Emit routine name if e == 1 and f is expected to correctly trigger fenv + exceptions. e allows declaration to be emitted conditionally upon certain + build flags - defer expansion by one pass to allow those flags to be expanded + properly. */ +#define PL_TEST_EXPECT_FENV(f, e) PL_TEST_EXPECT_FENV_ (f, e) +#define PL_TEST_EXPECT_FENV_(f, e) PL_TEST_EXPECT_FENV_##e (f) +#define PL_TEST_EXPECT_FENV_1(f) PL_TEST_EXPECT_FENV_ENABLED f |