blob: 09a6f270f7595edce5d80ff41a1e0189c2eb5d58 [file] [log] [blame]
Marshall Clowea7c7cc2013-10-05 21:19:49 +00001//===----------------------------------------------------------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is dual licensed under the MIT and the University of Illinois Open
6// Source Licenses. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
Asiri Rathnayake6edc12c2016-05-28 08:57:35 +000010// UNSUPPORTED: c++98, c++03, c++11
Marshall Clowea7c7cc2013-10-05 21:19:49 +000011// <chrono>
12
13#include <complex>
14#include <type_traits>
15#include <cassert>
16
17int main()
18{
Marshall Clowea7c7cc2013-10-05 21:19:49 +000019 using namespace std::literals;
20
21 {
22 std::complex<long double> c1 = 3.0il;
23 assert ( c1 == std::complex<long double>(0, 3.0));
24 auto c2 = 3il;
25 assert ( c1 == c2 );
26 }
Eric Fiselierd04c6852016-06-01 21:35:39 +000027
Marshall Clowea7c7cc2013-10-05 21:19:49 +000028 {
29 std::complex<double> c1 = 3.0i;
30 assert ( c1 == std::complex<double>(0, 3.0));
31 auto c2 = 3i;
32 assert ( c1 == c2 );
33 }
34
35 {
36 std::complex<float> c1 = 3.0if;
37 assert ( c1 == std::complex<float>(0, 3.0));
38 auto c2 = 3if;
39 assert ( c1 == c2 );
40 }
Marshall Clowea7c7cc2013-10-05 21:19:49 +000041}