[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 / epsilon.pass.cpp
blobd5f3bb0141b95028b2d1edf5d20dd56e1591da93
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 // epsilon()
13 #include <limits>
14 #include <cfloat>
15 #include <cassert>
17 #include "test_macros.h"
19 template <class T>
20 void
21 test(T expected)
23 assert(std::numeric_limits<T>::epsilon() == expected);
24 assert(std::numeric_limits<const T>::epsilon() == expected);
25 assert(std::numeric_limits<volatile T>::epsilon() == expected);
26 assert(std::numeric_limits<const volatile T>::epsilon() == expected);
29 int main(int, char**)
31 test<bool>(false);
32 test<char>(0);
33 test<signed char>(0);
34 test<unsigned char>(0);
35 test<wchar_t>(0);
36 #if TEST_STD_VER > 17 && defined(__cpp_char8_t)
37 test<char8_t>(0);
38 #endif
39 test<char16_t>(0);
40 test<char32_t>(0);
41 test<short>(0);
42 test<unsigned short>(0);
43 test<int>(0);
44 test<unsigned int>(0);
45 test<long>(0);
46 test<unsigned long>(0);
47 test<long long>(0);
48 test<unsigned long long>(0);
49 #ifndef TEST_HAS_NO_INT128
50 test<__int128_t>(0);
51 test<__uint128_t>(0);
52 #endif
53 test<float>(FLT_EPSILON);
54 test<double>(DBL_EPSILON);
55 test<long double>(LDBL_EPSILON);
57 return 0;