summaryrefslogtreecommitdiff
path: root/libc/test/src/math/smoke/log2f_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libc/test/src/math/smoke/log2f_test.cpp')
-rw-r--r--libc/test/src/math/smoke/log2f_test.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/libc/test/src/math/smoke/log2f_test.cpp b/libc/test/src/math/smoke/log2f_test.cpp
index 80e13a2374ad..56a46a5ad9a3 100644
--- a/libc/test/src/math/smoke/log2f_test.cpp
+++ b/libc/test/src/math/smoke/log2f_test.cpp
@@ -6,10 +6,10 @@
//
//===----------------------------------------------------------------------===//
+#include "hdr/errno_macros.h"
#include "hdr/math_macros.h"
#include "hdr/stdint_proxy.h"
#include "src/__support/FPUtil/FPBits.h"
-#include "src/__support/libc_errno.h"
#include "src/math/log2f.h"
#include "test/UnitTest/FPMatcher.h"
#include "test/UnitTest/Test.h"
@@ -22,12 +22,17 @@ TEST_F(LlvmLibcLog2fTest, SpecialNumbers) {
EXPECT_FP_EQ(aNaN, LIBC_NAMESPACE::log2f(aNaN));
EXPECT_FP_EQ(inf, LIBC_NAMESPACE::log2f(inf));
+ EXPECT_MATH_ERRNO(0);
EXPECT_FP_IS_NAN_WITH_EXCEPTION(LIBC_NAMESPACE::log2f(neg_inf), FE_INVALID);
+ EXPECT_MATH_ERRNO(EDOM);
EXPECT_FP_EQ_WITH_EXCEPTION(neg_inf, LIBC_NAMESPACE::log2f(0.0f),
FE_DIVBYZERO);
+ EXPECT_MATH_ERRNO(ERANGE);
EXPECT_FP_EQ_WITH_EXCEPTION(neg_inf, LIBC_NAMESPACE::log2f(-0.0f),
FE_DIVBYZERO);
+ EXPECT_MATH_ERRNO(ERANGE);
EXPECT_FP_IS_NAN_WITH_EXCEPTION(LIBC_NAMESPACE::log2f(-1.0f), FE_INVALID);
+ EXPECT_MATH_ERRNO(EDOM);
EXPECT_FP_EQ_ALL_ROUNDING(zero, LIBC_NAMESPACE::log2f(1.0f));
}
#ifdef LIBC_TEST_FTZ_DAZ