[PowerPC] Collect some CallLowering arguments into a struct. [NFC]
[llvm-project.git] / libcxx / test / std / numerics / complex.number / complex.ops / scalar_equals_complex.pass.cpp
blobd5dcc29182de08c1a073962a19071ce3854062a5
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 T& lhs, const complex<T>& rhs);
15 #include <complex>
16 #include <cassert>
18 #include "test_macros.h"
20 template <class T>
21 void
22 test_constexpr()
24 #if TEST_STD_VER > 11
26 constexpr T lhs(-2.5);
27 constexpr std::complex<T> rhs(1.5, 2.5);
28 static_assert(!(lhs == rhs), "");
31 constexpr T lhs(-2.5);
32 constexpr std::complex<T> rhs(1.5, 0);
33 static_assert(!(lhs == rhs), "");
36 constexpr T lhs(1.5);
37 constexpr std::complex<T> rhs(1.5, 2.5);
38 static_assert(!(lhs == rhs), "");
41 constexpr T lhs(1.5);
42 constexpr std::complex<T> rhs(1.5, 0);
43 static_assert(lhs == rhs, "");
45 #endif
48 template <class T>
49 void
50 test()
53 T lhs(-2.5);
54 std::complex<T> rhs(1.5, 2.5);
55 assert(!(lhs == rhs));
58 T lhs(-2.5);
59 std::complex<T> rhs(1.5, 0);
60 assert(!(lhs == rhs));
63 T lhs(1.5);
64 std::complex<T> rhs(1.5, 2.5);
65 assert(!(lhs == rhs));
68 T lhs(1.5);
69 std::complex<T> rhs(1.5, 0);
70 assert(lhs == rhs);
73 test_constexpr<T> ();
76 int main(int, char**)
78 test<float>();
79 test<double>();
80 test<long double>();
81 // test_constexpr<int>();
83 return 0;