[PowerPC] Collect some CallLowering arguments into a struct. [NFC]
[llvm-project.git] / libcxx / test / std / numerics / complex.number / complex.ops / scalar_plus_complex.pass.cpp
blob6f8e0495b475c4c92f2afbd14bcf8cca427b7b95
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 // 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(const T& lhs, const std::complex<T>& rhs, std::complex<T> x)
24 assert(lhs + rhs == x);
27 template <class T>
28 void
29 test()
32 T lhs(1.5);
33 std::complex<T> rhs(3.5, 4.5);
34 std::complex<T> x(5.0, 4.5);
35 test(lhs, rhs, x);
38 T lhs(1.5);
39 std::complex<T> rhs(-3.5, 4.5);
40 std::complex<T> x(-2.0, 4.5);
41 test(lhs, rhs, x);
45 int main(int, char**)
47 test<float>();
48 test<double>();
49 test<long double>();
51 return 0;