aboutsummaryrefslogtreecommitdiff
path: root/libc/test/src/complex/cprojf_test.cpp
blob: 4635aa17ad02d279e830c1cd0a17f6deceb7f3eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
//===-- Unittests for cprojf ----------------------------------------------===//
//
// 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 "CprojTest.h"

#include "src/complex/cprojf.h"

#include "utils/MPCWrapper/MPCUtils.h"

using LlvmLibcCprojTestMPC = LIBC_NAMESPACE::testing::FPTest<float>;

namespace mpc = LIBC_NAMESPACE::testing::mpc;

TEST_F(LlvmLibcCprojTestMPC, MPCRND) {
  _Complex float test = 5.0 + 10.0i;
  EXPECT_MPC_MATCH_ALL_ROUNDING(mpc::Operation::Cproj, test,
                                LIBC_NAMESPACE::cprojf(test), 0.5);
}

LIST_CPROJ_TESTS(_Complex float, float, LIBC_NAMESPACE::cprojf)