[RISCV] Fix mgather -> riscv.masked.strided.load combine not extending indices (...
[llvm-project.git] / libcxx / test / std / language.support / support.limits / limits / numeric.limits.members / traps.pass.cpp
bloba9b1e44602bd2995d78a185a23b7a8553d2d6659
1 //===----------------------------------------------------------------------===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
9 // test numeric_limits
11 // traps
13 #include <limits>
15 #include "test_macros.h"
17 #if defined(__i386__) || defined(__x86_64__) || defined(__pnacl__) || \
18 defined(__wasm__)
19 static const bool integral_types_trap = true;
20 #else
21 static const bool integral_types_trap = false;
22 #endif
24 template <class T, bool expected>
25 void
26 test()
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");
34 int main(int, char**)
36 test<bool, false>();
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>();
43 #endif
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>();
57 #endif
58 test<float, false>();
59 test<double, false>();
60 test<long double, false>();
62 return 0;