1 //===----------------------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
15 #include "test_macros.h"
17 #if defined(__i386__) || defined(__x86_64__) || defined(__pnacl__) || \
19 static const bool integral_types_trap
= true;
21 static const bool integral_types_trap
= false;
24 template <class T
, bool expected
>
28 static_assert(std::numeric_limits
<T
>::traps
== expected
, "traps test 1");
29 static_assert(std::numeric_limits
<const T
>::traps
== expected
, "traps test 2");
30 static_assert(std::numeric_limits
<volatile T
>::traps
== expected
, "traps test 3");
31 static_assert(std::numeric_limits
<const volatile T
>::traps
== expected
, "traps test 4");
37 test
<char, integral_types_trap
>();
38 test
<signed char, integral_types_trap
>();
39 test
<unsigned char, integral_types_trap
>();
40 test
<wchar_t, integral_types_trap
>();
41 #if TEST_STD_VER > 17 && defined(__cpp_char8_t)
42 test
<char8_t
, integral_types_trap
>();
44 test
<char16_t
, integral_types_trap
>();
45 test
<char32_t
, integral_types_trap
>();
46 test
<short, integral_types_trap
>();
47 test
<unsigned short, integral_types_trap
>();
48 test
<int, integral_types_trap
>();
49 test
<unsigned int, integral_types_trap
>();
50 test
<long, integral_types_trap
>();
51 test
<unsigned long, integral_types_trap
>();
52 test
<long long, integral_types_trap
>();
53 test
<unsigned long long, integral_types_trap
>();
54 #ifndef TEST_HAS_NO_INT128
55 test
<__int128_t
, integral_types_trap
>();
56 test
<__uint128_t
, integral_types_trap
>();
59 test
<double, false>();
60 test
<long double, false>();