[PowerPC] Collect some CallLowering arguments into a struct. [NFC]
[llvm-project.git] / libcxx / test / std / numerics / complex.number / complex.literals / literals.pass.cpp
blob7d8d701fda6b898da83c740ae0b83a65703b639e
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 // UNSUPPORTED: c++98, c++03, c++11
10 // <chrono>
12 #include <complex>
13 #include <type_traits>
14 #include <cassert>
16 #include "test_macros.h"
18 int main(int, char**)
20 using namespace std::literals::complex_literals;
22 // Make sure the types are right
23 static_assert ( std::is_same<decltype( 3.0il ), std::complex<long double>>::value, "" );
24 static_assert ( std::is_same<decltype( 3il ), std::complex<long double>>::value, "" );
25 static_assert ( std::is_same<decltype( 3.0i ), std::complex<double>>::value, "" );
26 static_assert ( std::is_same<decltype( 3i ), std::complex<double>>::value, "" );
27 static_assert ( std::is_same<decltype( 3.0if ), std::complex<float>>::value, "" );
28 static_assert ( std::is_same<decltype( 3if ), std::complex<float>>::value, "" );
31 std::complex<long double> c1 = 3.0il;
32 assert ( c1 == std::complex<long double>(0, 3.0));
33 auto c2 = 3il;
34 assert ( c1 == c2 );
38 std::complex<double> c1 = 3.0i;
39 assert ( c1 == std::complex<double>(0, 3.0));
40 auto c2 = 3i;
41 assert ( c1 == c2 );
45 std::complex<float> c1 = 3.0if;
46 assert ( c1 == std::complex<float>(0, 3.0));
47 auto c2 = 3if;
48 assert ( c1 == c2 );
51 return 0;