1//===----------------------------------------------------------------------===//
2//
3//                     The LLVM Compiler Infrastructure
4//
5// This file is dual licensed under the MIT and the University of Illinois Open
6// Source Licenses. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10// test numeric_limits
11
12// has_denorm_loss
13
14#include <limits>
15
16template <class T, bool expected>
17void
18test()
19{
20    static_assert(std::numeric_limits<T>::has_denorm_loss == expected, "has_denorm_loss test 1");
21    static_assert(std::numeric_limits<const T>::has_denorm_loss == expected, "has_denorm_loss test 2");
22    static_assert(std::numeric_limits<volatile T>::has_denorm_loss == expected, "has_denorm_loss test 3");
23    static_assert(std::numeric_limits<const volatile T>::has_denorm_loss == expected, "has_denorm_loss test 4");
24}
25
26int main()
27{
28    test<bool, false>();
29    test<char, false>();
30    test<signed char, false>();
31    test<unsigned char, false>();
32    test<wchar_t, false>();
33#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
34    test<char16_t, false>();
35    test<char32_t, false>();
36#endif  // _LIBCPP_HAS_NO_UNICODE_CHARS
37    test<short, false>();
38    test<unsigned short, false>();
39    test<int, false>();
40    test<unsigned int, false>();
41    test<long, false>();
42    test<unsigned long, false>();
43    test<long long, false>();
44    test<unsigned long long, false>();
45#ifndef _LIBCPP_HAS_NO_INT128
46    test<__int128_t, false>();
47    test<__uint128_t, false>();
48#endif
49    test<float, false>();
50    test<double, false>();
51    test<long double, false>();
52}
53