1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // test numeric_limits
16 #include <type_traits>
21 test_imp(std::true_type)
23 assert(std::isnan(std::numeric_limits<T>::signaling_NaN()));
24 assert(std::isnan(std::numeric_limits<const T>::signaling_NaN()));
25 assert(std::isnan(std::numeric_limits<volatile T>::signaling_NaN()));
26 assert(std::isnan(std::numeric_limits<const volatile T>::signaling_NaN()));
31 test_imp(std::false_type)
33 assert(std::numeric_limits<T>::signaling_NaN() == T());
34 assert(std::numeric_limits<const T>::signaling_NaN() == T());
35 assert(std::numeric_limits<volatile T>::signaling_NaN() == T());
36 assert(std::numeric_limits<const volatile T>::signaling_NaN() == T());
44 test_imp<T>(std::is_floating_point<T>());
52 test<unsigned char>();
54 #ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
57 #endif // _LIBCPP_HAS_NO_UNICODE_CHARS
59 test<unsigned short>();
63 test<unsigned long>();
65 test<unsigned long long>();