Skip to content

Commit 8e6bbb7

Browse files
committed
test: Waive issues in frexp* functions in msvcrt.dll on ARM
These issues appear when testing with the real msvcrt.dll on ARM; if testing in Wine, these functions behave as expected.
1 parent 14dad0c commit 8e6bbb7

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

test/crt-test.c

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@
3434
#include <windows.h>
3535
#endif
3636

37-
#if defined(__MINGW32__) && defined(__MSVCRT_VERSION__) && __MSVCRT_VERSION__ < 0xE00 && defined(__USE_MINGW_ANSI_STDIO) && __USE_MINGW_ANSI_STDIO == 0
37+
#if defined(__MINGW32__) && defined(__MSVCRT_VERSION__) && __MSVCRT_VERSION__ < 0xE00
38+
#define MSVCRT_DLL
39+
#endif
40+
#if defined(MSVCRT_DLL) && defined(__USE_MINGW_ANSI_STDIO) && __USE_MINGW_ANSI_STDIO == 0
3841
#define MSVCRT_DLL_NOANSI
3942
#endif
4043

@@ -1132,17 +1135,25 @@ void test_math_inspect_manipulate() {
11321135

11331136
int iret;
11341137
#define TEST_FREXP(frexp) \
1135-
TEST_FLT(frexp(F(INFINITY), &iret), INFINITY); \
1136-
TEST_FLT(frexp(F(-INFINITY), &iret), -INFINITY); \
11371138
TEST_FLT_NAN(frexp(F(NAN), &iret), F(NAN)); \
11381139
TEST_FLT_NAN(frexp(-F(NAN), &iret), -F(NAN)); \
11391140
iret = 0; \
11401141
TEST_FLT(frexp(F(0x1.4p+42), &iret), 0.625); \
11411142
TEST_INT(iret, 43)
11421143

1144+
#define TEST_FREXP_INF(frexp) \
1145+
TEST_FLT(frexp(F(INFINITY), &iret), INFINITY); \
1146+
TEST_FLT(frexp(F(-INFINITY), &iret), -INFINITY)
1147+
11431148
TEST_FREXP(frexp);
11441149
TEST_FREXP(frexpf);
11451150
TEST_FREXP(frexpl);
1151+
#if !defined(MSVCRT_DLL) || !(defined(__arm__) || defined(__aarch64__))
1152+
// On msvcrt.dll on arm, frexp*(INFINITY) returns NAN, not INFINITY.
1153+
TEST_FREXP_INF(frexp);
1154+
TEST_FREXP_INF(frexpf);
1155+
TEST_FREXP_INF(frexpl);
1156+
#endif
11461157

11471158
#define TEST_ILOGB(ilogb) \
11481159
TEST_INT(ilogb(F(1.0)), 0); \

0 commit comments

Comments
 (0)