[PowerPC] Collect some CallLowering arguments into a struct. [NFC]
[llvm-project.git] / libcxx / test / std / numerics / complex.number / complex.member.ops / assignment_scalar.pass.cpp
blob176c3c7591c3d55148ec69e5d4748191cf64a5aa
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 // complex& operator= (const T&);
13 #include <complex>
14 #include <cassert>
16 #include "test_macros.h"
18 template <class T>
19 void
20 test()
22 std::complex<T> c;
23 assert(c.real() == 0);
24 assert(c.imag() == 0);
25 c = 1.5;
26 assert(c.real() == 1.5);
27 assert(c.imag() == 0);
28 c = -1.5;
29 assert(c.real() == -1.5);
30 assert(c.imag() == 0);
33 int main(int, char**)
35 test<float>();
36 test<double>();
37 test<long double>();
39 return 0;