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 //===----------------------------------------------------------------------===//
8 
9 // <complex>
10 
11 // template<class T>
12 //   T
13 //   imag(const complex<T>& x);
14 
15 #include <complex>
16 #include <cassert>
17 
18 template <class T>
19 void
20 test()
21 {
22     std::complex<T> z(1.5, 2.5);
23     assert(imag(z) == 2.5);
24 }
25 
26 int main(int, char**)
27 {
28     test<float>();
29     test<double>();
30     test<long double>();
31 
32   return 0;
33 }
34