summaryrefslogtreecommitdiff
path: root/libc/test/src/math/smoke/log1p_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libc/test/src/math/smoke/log1p_test.cpp')
-rw-r--r--libc/test/src/math/smoke/log1p_test.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/libc/test/src/math/smoke/log1p_test.cpp b/libc/test/src/math/smoke/log1p_test.cpp
index 61c56cd2c6dd..3b9dd0558ba6 100644
--- a/libc/test/src/math/smoke/log1p_test.cpp
+++ b/libc/test/src/math/smoke/log1p_test.cpp
@@ -6,9 +6,9 @@
//
//===----------------------------------------------------------------------===//
+#include "hdr/errno_macros.h"
#include "hdr/math_macros.h"
#include "src/__support/FPUtil/FPBits.h"
-#include "src/__support/libc_errno.h"
#include "src/math/log1p.h"
#include "test/UnitTest/FPMatcher.h"
#include "test/UnitTest/Test.h"
@@ -21,12 +21,16 @@ TEST_F(LlvmLibcLog1pTest, SpecialNumbers) {
EXPECT_FP_EQ(aNaN, LIBC_NAMESPACE::log1p(aNaN));
EXPECT_FP_EQ(inf, LIBC_NAMESPACE::log1p(inf));
+ EXPECT_MATH_ERRNO(0);
EXPECT_FP_IS_NAN_WITH_EXCEPTION(LIBC_NAMESPACE::log1p(neg_inf), FE_INVALID);
+ EXPECT_MATH_ERRNO(EDOM);
EXPECT_FP_IS_NAN_WITH_EXCEPTION(LIBC_NAMESPACE::log1p(-2.0), FE_INVALID);
+ EXPECT_MATH_ERRNO(EDOM);
EXPECT_FP_EQ(zero, LIBC_NAMESPACE::log1p(0.0));
EXPECT_FP_EQ(neg_zero, LIBC_NAMESPACE::log1p(-0.0));
EXPECT_FP_EQ_WITH_EXCEPTION(neg_inf, LIBC_NAMESPACE::log1p(-1.0),
FE_DIVBYZERO);
+ EXPECT_MATH_ERRNO(ERANGE);
EXPECT_FP_EQ(0x1.62c829bf8fd9dp9,
LIBC_NAMESPACE::log1p(0x1.9b536cac3a09dp1023));