[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 / round_style.pass.cpp
blob5b0b745ac5ab0af2a984c70e93ddb8dbf2aaf6fe
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 // round_style
13 #include <limits>
15 #include "test_macros.h"
17 template <class T, std::float_round_style expected>
18 void
19 test()
21 static_assert(std::numeric_limits<T>::round_style == expected, "round_style test 1");
22 static_assert(std::numeric_limits<const T>::round_style == expected, "round_style test 2");
23 static_assert(std::numeric_limits<volatile T>::round_style == expected, "round_style test 3");
24 static_assert(std::numeric_limits<const volatile T>::round_style == expected, "round_style test 4");
27 int main(int, char**)
29 test<bool, std::round_toward_zero>();
30 test<char, std::round_toward_zero>();
31 test<signed char, std::round_toward_zero>();
32 test<unsigned char, std::round_toward_zero>();
33 test<wchar_t, std::round_toward_zero>();
34 #if TEST_STD_VER > 17 && defined(__cpp_char8_t)
35 test<char8_t, std::round_toward_zero>();
36 #endif
37 test<char16_t, std::round_toward_zero>();
38 test<char32_t, std::round_toward_zero>();
39 test<short, std::round_toward_zero>();
40 test<unsigned short, std::round_toward_zero>();
41 test<int, std::round_toward_zero>();
42 test<unsigned int, std::round_toward_zero>();
43 test<long, std::round_toward_zero>();
44 test<unsigned long, std::round_toward_zero>();
45 test<long long, std::round_toward_zero>();
46 test<unsigned long long, std::round_toward_zero>();
47 #ifndef TEST_HAS_NO_INT128
48 test<__int128_t, std::round_toward_zero>();
49 test<__uint128_t, std::round_toward_zero>();
50 #endif
51 test<float, std::round_to_nearest>();
52 test<double, std::round_to_nearest>();
53 test<long double, std::round_to_nearest>();
55 return 0;