Revert "[libc] Use best-fit binary trie to make malloc logarithmic" (#117065)
[llvm-project.git] / libc / test / src / stdfix / uksqrtui_test.cpp
blobc336d0ce1f6176321276ef5c55da68357205df5e
1 //===-- Unittests for uksqrtui --------------------------------------------===//
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 //===----------------------------------------------------------------------===//
9 #include "ISqrtTest.h"
11 #include "src/__support/fixed_point/sqrt.h"
12 #include "src/stdfix/uksqrtui.h"
14 unsigned accum uksqrtui_fast(unsigned int x) {
15 return LIBC_NAMESPACE::fixed_point::isqrt_fast(x);
18 LIST_ISQRT_TESTS(UI, unsigned int, LIBC_NAMESPACE::uksqrtui);
20 TEST_F(LlvmLibcISqrtUITest, LargeInteger) {
21 testSpecificInput(65529u, LIBC_NAMESPACE::uksqrtui(65529u), 0x1.fff8fep7,
22 0x3.0p-16);
25 LIST_ISQRT_TESTS(UIFast, unsigned int, uksqrtui_fast);
27 TEST_F(LlvmLibcISqrtUIFastTest, LargeInteger) {
28 testSpecificInput(65529u, uksqrtui_fast(65529u), 0x1.fff8fep7, 0x3.0p-16);