summaryrefslogtreecommitdiff
path: root/libc/test/src/math/ilogbl_test.cpp
diff options
context:
space:
mode:
authorSiva Chandra Reddy <sivachandra@google.com>2020-11-03 16:30:16 -0800
committerSiva Chandra Reddy <sivachandra@google.com>2020-11-05 16:27:44 -0800
commit930cf1cb9fdb77138dedf5ac4afc2ebfc46d63a3 (patch)
tree9af658c77bc5ea252b8e7db11a3fdae8035fbe89 /libc/test/src/math/ilogbl_test.cpp
parente9e2e3107d6b4fb1bfdd877a83f1e214fcefea76 (diff)
[libc] Add implementations of ilogb[f|l].
Depends on D90805. Reviewed By: lntue Differential Revision: https://reviews.llvm.org/D90806
Diffstat (limited to 'libc/test/src/math/ilogbl_test.cpp')
-rw-r--r--libc/test/src/math/ilogbl_test.cpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/libc/test/src/math/ilogbl_test.cpp b/libc/test/src/math/ilogbl_test.cpp
new file mode 100644
index 000000000000..6404c6b00fd1
--- /dev/null
+++ b/libc/test/src/math/ilogbl_test.cpp
@@ -0,0 +1,41 @@
+//===-- Unittests for ilogbl ----------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "ILogbTest.h"
+
+#include "include/math.h"
+#include "src/math/ilogbl.h"
+#include "utils/CPP/Functional.h"
+#include "utils/FPUtil/FPBits.h"
+#include "utils/FPUtil/ManipulationFunctions.h"
+#include "utils/FPUtil/TestHelpers.h"
+#include "utils/UnitTest/Test.h"
+
+#include <limits.h>
+
+using RunContext = __llvm_libc::testing::RunContext;
+
+TEST_F(ILogbTest, SpecialNumbers_ilogbl) {
+ testSpecialNumbers<long double>(&__llvm_libc::ilogbl);
+}
+
+TEST_F(ILogbTest, PowersOfTwo_ilogbl) {
+ testPowersOfTwo<long double>(&__llvm_libc::ilogbl);
+}
+
+TEST_F(ILogbTest, SomeIntegers_ilogbl) {
+ testSomeIntegers<long double>(&__llvm_libc::ilogbl);
+}
+
+TEST_F(ILogbTest, SubnormalRange_ilogbl) {
+ testSubnormalRange<long double>(&__llvm_libc::ilogbl);
+}
+
+TEST_F(ILogbTest, NormalRange_ilogbl) {
+ testNormalRange<long double>(&__llvm_libc::ilogbl);
+}