1 //===----------------------------------------------------------------------===//
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
7 //===----------------------------------------------------------------------===//
11 // template<Arithmetic T>
16 #include <type_traits>
19 #include "test_macros.h"
24 test(T x
, typename
std::enable_if
<std::is_integral
<T
>::value
>::type
* = 0)
26 static_assert((std::is_same
<decltype(std::arg(x
)), double>::value
), "");
27 assert(std::arg(x
) == arg(std::complex<double>(static_cast<double>(x
), 0)));
32 test(T x
, typename
std::enable_if
<!std::is_integral
<T
>::value
>::type
* = 0)
34 static_assert((std::is_same
<decltype(std::arg(x
)), T
>::value
), "");
35 assert(std::arg(x
) == arg(std::complex<T
>(x
, 0)));