Index: compiler-rt/test/builtins/Unit/compiler_rt_scalbn_test.c =================================================================== --- compiler-rt/test/builtins/Unit/compiler_rt_scalbn_test.c +++ compiler-rt/test/builtins/Unit/compiler_rt_scalbn_test.c @@ -62,8 +62,9 @@ #if (defined(__arm__) || defined(__aarch64__)) && defined(__ARM_FP) || \ defined(__i386__) || defined(__x86_64__) // Skip these tests for MSVC because its scalbn function always behaves as if -// the default rounding mode is set (FE_TONEAREST). -#ifndef _MSC_VER +// the default rounding mode is set (FE_TONEAREST), and for newlib because the +// implementation can give different results in certain cases. +#if !defined(_MSC_VER) && !defined(_NEWLIB_VERSION) fesetround(FE_UPWARD); if (iterate_cases("FE_UPWARD")) return 1; Index: compiler-rt/test/builtins/Unit/compiler_rt_scalbnf_test.c =================================================================== --- compiler-rt/test/builtins/Unit/compiler_rt_scalbnf_test.c +++ compiler-rt/test/builtins/Unit/compiler_rt_scalbnf_test.c @@ -60,9 +60,10 @@ // should have the same rounding behavior as single-precision multiplication. #if (defined(__arm__) || defined(__aarch64__)) && defined(__ARM_FP) || \ defined(__i386__) || defined(__x86_64__) -// Skip these tests for MSVC because its scalbnf function always behaves as if -// the default rounding mode is set (FE_TONEAREST). -#ifndef _MSC_VER +// Skip these tests for MSVC because its scalbn function always behaves as if +// the default rounding mode is set (FE_TONEAREST), and for newlib because the +// implementation can give different results in certain cases. +#if !defined(_MSC_VER) && !defined(_NEWLIB_VERSION) fesetround(FE_UPWARD); if (iterate_cases("FE_UPWARD")) return 1;