Revert "test: crt-test: Skip a test for cos(-NAN) == -NAN when optimizing"

This reverts commit 1d8c107d49.

After 49e14021be, when using F(-NAN)
instead of -F(NAN) to hide the negation, this test passes correctly.
I hadn't realized that GCC and Clang optimized cos(-x) = cos(x), when
I made 1d8c107d49 (and at the time, the
F() macro didn't work properly with -NAN on all toolchains).
This commit is contained in:
Martin Storsjö
2026-04-24 15:36:37 +03:00
parent 49e14021be
commit 61ddd976fe
+2 -8
View File
@@ -1476,19 +1476,13 @@ void test_math_trig() {
TEST_FLT_ACCURACY(cos(2*F(3.141592654)), 1.0, 0.01); \
TEST_FLT_NAN_ANY(cos(F(INFINITY))); \
TEST_FLT_NAN_ANY(cos(F(-INFINITY))); \
TEST_FLT_NAN(cos(F(NAN)), F(NAN))
TEST_FLT_NAN(cos(F(NAN)), F(NAN)); \
TEST_FLT_NAN(cos(F(-NAN)), F(-NAN))
TEST_COS(cos);
TEST_COS(cosf);
TEST_COS(cosl);
#ifndef __OPTIMIZE__
// GCC and Clang break this test when optimizing.
TEST_FLT_NAN(cos(F(-NAN)), F(-NAN));
TEST_FLT_NAN(cosf(F(-NAN)), F(-NAN));
TEST_FLT_NAN(cosl(F(-NAN)), F(-NAN));
#endif
#define TEST_SIN(sin) \
TEST_FLT_ACCURACY(sin(F(0.0)), 0.0, 0.01); \
TEST_FLT_ACCURACY(sin(F(3.141592654)/2), 1.0, 0.01); \