[PowerPC] Collect some CallLowering arguments into a struct. [NFC]
[llvm-project.git] / libcxx / test / std / numerics / complex.number / complex.member.ops / times_equal_scalar.pass.cpp
blob600c79f8d2100357568882209c29ecd8ba2613c3
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& rhs);
13 #include <complex>
14 #include <cassert>
16 #include "test_macros.h"
18 template <class T>
19 void
20 test()
22 std::complex<T> c(1);
23 assert(c.real() == 1);
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() == 2.25);
30 assert(c.imag() == 0);
31 c *= -1.5;
32 assert(c.real() == -3.375);
33 assert(c.imag() == 0);
34 c.imag(2);
35 c *= 1.5;
36 assert(c.real() == -5.0625);
37 assert(c.imag() == 3);
40 int main(int, char**)
42 test<float>();
43 test<double>();
44 test<long double>();
46 return 0;