]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/std/language.support/support.limits/limits/numeric.limits.members/tinyness_before.pass.cpp
Vendor import of libc++ trunk r351319 (just before the release_80
[FreeBSD/FreeBSD.git] / test / std / language.support / support.limits / limits / numeric.limits.members / tinyness_before.pass.cpp
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 // tinyness_before
13
14 #include <limits>
15
16 #include "test_macros.h"
17
18 template <class T, bool expected>
19 void
20 test()
21 {
22     static_assert(std::numeric_limits<T>::tinyness_before == expected, "tinyness_before test 1");
23     static_assert(std::numeric_limits<const T>::tinyness_before == expected, "tinyness_before test 2");
24     static_assert(std::numeric_limits<volatile T>::tinyness_before == expected, "tinyness_before test 3");
25     static_assert(std::numeric_limits<const volatile T>::tinyness_before == expected, "tinyness_before test 4");
26 }
27
28 int main()
29 {
30     test<bool, false>();
31     test<char, false>();
32     test<signed char, false>();
33     test<unsigned char, false>();
34     test<wchar_t, false>();
35 #if TEST_STD_VER > 17 && defined(__cpp_char8_t)
36     test<char8_t, false>();
37 #endif
38 #ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
39     test<char16_t, false>();
40     test<char32_t, false>();
41 #endif  // _LIBCPP_HAS_NO_UNICODE_CHARS
42     test<short, false>();
43     test<unsigned short, false>();
44     test<int, false>();
45     test<unsigned int, false>();
46     test<long, false>();
47     test<unsigned long, false>();
48     test<long long, false>();
49     test<unsigned long long, false>();
50 #ifndef _LIBCPP_HAS_NO_INT128
51     test<__int128_t, false>();
52     test<__uint128_t, false>();
53 #endif
54     test<float, false>();
55     test<double, false>();
56     test<long double, false>();
57 }