//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // template // T // norm(T x); #include #include #include #include "test_macros.h" #include "../cases.h" template void test(T x, typename std::enable_if::value>::type* = 0) { static_assert((std::is_same::value), ""); assert(std::norm(x) == norm(std::complex(static_cast(x), 0))); } template void test(T x, typename std::enable_if::value>::type* = 0) { static_assert((std::is_same::value), ""); assert(std::norm(x) == norm(std::complex(x, 0))); } template void test() { test(0); test(1); test(10); } int main(int, char**) { test(); test(); test(); test(); test(); test(); return 0; }