Remove building with NOCRYPTO option
[minix.git] / external / bsd / libc++ / dist / libcxx / test / numerics / complex.number / layout.pass.cpp
bloba9f356d4a40aeb78a5cb7a14293e2c46d2273335
1 //===----------------------------------------------------------------------===//
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 //===----------------------------------------------------------------------===//
10 // <complex>
12 #include <complex>
13 #include <cassert>
15 template <class T>
16 void
17 test()
19 std::complex<T> z;
20 T* a = (T*)&z;
21 assert(0 == z.real());
22 assert(0 == z.imag());
23 assert(a[0] == z.real());
24 assert(a[1] == z.imag());
25 a[0] = 5;
26 a[1] = 6;
27 assert(a[0] == z.real());
28 assert(a[1] == z.imag());
31 int main()
33 test<float>();
34 test<double>();
35 test<long double>();