Revert "[libc] Use best-fit binary trie to make malloc logarithmic" (#117065)
[llvm-project.git] / libcxx / test / std / numerics / complex.number / complex.ops / complex_not_equals_complex.pass.cpp
blob81adc690dc26ee02ddae9ea47f21dabb0649294a
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 // bool
13 // operator!=(const complex<T>& lhs, const complex<T>& rhs);
15 #include <complex>
16 #include <cassert>
18 #include "test_macros.h"
20 template <class T>
21 TEST_CONSTEXPR_CXX20
22 void
23 test_constexpr()
25 #if TEST_STD_VER > 11
27 constexpr std::complex<T> lhs(1.5, 2.5);
28 constexpr std::complex<T> rhs(1.5, -2.5);
29 static_assert(lhs != rhs, "");
32 constexpr std::complex<T> lhs(1.5, 2.5);
33 constexpr std::complex<T> rhs(1.5, 2.5);
34 static_assert(!(lhs != rhs), "" );
36 #endif
39 template <class T>
40 TEST_CONSTEXPR_CXX20
41 bool
42 test()
45 const std::complex<T> lhs(1.5, 2.5);
46 const std::complex<T> rhs(1.5, -2.5);
47 assert(lhs != rhs);
50 const std::complex<T> lhs(1.5, 2.5);
51 const std::complex<T> rhs(1.5, 2.5);
52 assert(!(lhs != rhs));
55 test_constexpr<T> ();
56 return true;
59 int main(int, char**)
61 test<float>();
62 test<double>();
63 test<long double>();
65 #if TEST_STD_VER > 17
66 static_assert(test<float>());
67 static_assert(test<double>());
68 static_assert(test<long double>());
69 #endif
71 return 0;