//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // test numeric_limits // infinity() #include #include #include template void test(T expected) { assert(std::numeric_limits::infinity() == expected); assert(std::numeric_limits::infinity() == expected); assert(std::numeric_limits::infinity() == expected); assert(std::numeric_limits::infinity() == expected); } extern float zero; int main() { test(false); test(0); test(0); test(0); test(0); #ifndef _LIBCPP_HAS_NO_UNICODE_CHARS test(0); test(0); #endif // _LIBCPP_HAS_NO_UNICODE_CHARS test(0); test(0); test(0); test(0); test(0); test(0); test(0); test(0); #ifndef _LIBCPP_HAS_NO_INT128 test<__int128_t>(0); test<__uint128_t>(0); #endif test(1./zero); test(1./zero); test(1./zero); } float zero = 0;