Revert "[libc] Use best-fit binary trie to make malloc logarithmic" (#117065)
[llvm-project.git] / libcxx / test / std / numerics / complex.number / complex.value.ops / conj.pass.cpp
blobd24673cc8f33ba111ace4bf54d302ff03a303596
1 //===----------------------------------------------------------------------===//
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 // <complex>
11 // template<class T>
12 // complex<T>
13 // conj(const complex<T>& x);
15 #include <complex>
16 #include <cassert>
18 #include "test_macros.h"
20 template <class T>
21 void
22 test(const std::complex<T>& z, std::complex<T> x)
24 assert(conj(z) == x);
27 template <class T>
28 void
29 test()
31 test(std::complex<T>(1, 2), std::complex<T>(1, -2));
32 test(std::complex<T>(-1, 2), std::complex<T>(-1, -2));
33 test(std::complex<T>(1, -2), std::complex<T>(1, 2));
34 test(std::complex<T>(-1, -2), std::complex<T>(-1, 2));
37 int main(int, char**)
39 test<float>();
40 test<double>();
41 test<long double>();
43 return 0;