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 "include/math.h" 12 #include "src/math/ilogb.h" 13 #include "utils/CPP/Functional.h" 14 #include "utils/FPUtil/FPBits.h" 15 #include "utils/FPUtil/ManipulationFunctions.h" 16 #include "utils/FPUtil/TestHelpers.h" 17 #include "utils/UnitTest/Test.h" 18 19 #include <limits.h> 20 21 using RunContext = __llvm_libc::testing::RunContext; 22 23 TEST_F(ILogbTest, SpecialNumbers_ilogb) { 24 testSpecialNumbers<double>(&__llvm_libc::ilogb); 25 } 26 27 TEST_F(ILogbTest, PowersOfTwo_ilogb) { 28 testPowersOfTwo<double>(&__llvm_libc::ilogb); 29 } 30 31 TEST_F(ILogbTest, SomeIntegers_ilogb) { 32 testSomeIntegers<double>(&__llvm_libc::ilogb); 33 } 34 35 TEST_F(ILogbTest, SubnormalRange_ilogb) { 36 testSubnormalRange<double>(&__llvm_libc::ilogb); 37 } 38 39 TEST_F(ILogbTest, NormalRange_ilogb) { 40 testNormalRange<double>(&__llvm_libc::ilogb); 41 } 42