xref: /aosp_15_r20/external/llvm-libc/test/src/math/ilogb_test.cpp (revision 71db0c75aadcf003ffe3238005f61d7618a3fead)
1 //===-- Unittests for ilogb -----------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #include "ILogbTest.h"
10 
11 #include "hdr/math_macros.h"
12 #include "src/__support/FPUtil/FPBits.h"
13 #include "src/__support/FPUtil/ManipulationFunctions.h"
14 #include "src/math/ilogb.h"
15 #include "test/UnitTest/FPMatcher.h"
16 #include "test/UnitTest/Test.h"
17 
TEST_F(LlvmLibcILogbTest,SpecialNumbers_ilogb)18 TEST_F(LlvmLibcILogbTest, SpecialNumbers_ilogb) {
19   test_special_numbers<double>(&LIBC_NAMESPACE::ilogb);
20 }
21 
TEST_F(LlvmLibcILogbTest,PowersOfTwo_ilogb)22 TEST_F(LlvmLibcILogbTest, PowersOfTwo_ilogb) {
23   test_powers_of_two<double>(&LIBC_NAMESPACE::ilogb);
24 }
25 
TEST_F(LlvmLibcILogbTest,SomeIntegers_ilogb)26 TEST_F(LlvmLibcILogbTest, SomeIntegers_ilogb) {
27   test_some_integers<double>(&LIBC_NAMESPACE::ilogb);
28 }
29 
TEST_F(LlvmLibcILogbTest,SubnormalRange_ilogb)30 TEST_F(LlvmLibcILogbTest, SubnormalRange_ilogb) {
31   test_subnormal_range<double>(&LIBC_NAMESPACE::ilogb);
32 }
33 
TEST_F(LlvmLibcILogbTest,NormalRange_ilogb)34 TEST_F(LlvmLibcILogbTest, NormalRange_ilogb) {
35   test_normal_range<double>(&LIBC_NAMESPACE::ilogb);
36 }
37