[PowerPC] Collect some CallLowering arguments into a struct. [NFC]
[llvm-project.git] / libcxx / test / std / numerics / complex.number / complex.member.ops / minus_equal_scalar.pass.cpp
blob6fccd8bcb9fe57fc940b65c3d81ce903b68dce46
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;
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() == -3);
30 assert(c.imag() == 0);
31 c -= -1.5;
32 assert(c.real() == -1.5);
33 assert(c.imag() == 0);
36 int main(int, char**)
38 test<float>();
39 test<double>();
40 test<long double>();
42 return 0;