mirror of
https://github.com/mstorsjo/llvm-mingw
synced 2026-06-21 14:01:00 +00:00
Revert "test: crt-test: Skip a test for cos(-NAN) == -NAN when optimizing"
This reverts commit1d8c107d49. After49e14021be, 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 made1d8c107d49(and at the time, the F() macro didn't work properly with -NAN on all toolchains).
This commit is contained in:
+2
-8
@@ -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); \
|
||||
|
||||
Reference in New Issue
Block a user