[RISCV] Fix mgather -> riscv.masked.strided.load combine not extending indices (...
[llvm-project.git] / libcxx / test / std / language.support / support.limits / limits / is_specialized.pass.cpp
blobf27c73157582d26e5adec987c8b4ecfab4ecde10
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 // Specializations shall be provided for each arithmetic type, both floating
12 // point and integer, including bool. The member is_specialized shall be
13 // true for all such specializations of numeric_limits.
15 // Non-arithmetic standard types, such as complex<T> (26.3.2), shall not
16 // have specializations.
18 // From [numeric.limits]:
20 // The value of each member of a specialization of numeric_limits on a cv
21 // -qualified type cv T shall be equal to the value of the corresponding
22 // member of the specialization on the unqualified type T.
24 // More convenient to test it here.
26 #include <limits>
27 #include <complex>
29 #include "type_algorithms.h"
31 struct Test {
32 template <class T>
33 void operator()() {
34 static_assert(std::numeric_limits<T>::is_specialized,
35 "std::numeric_limits<T>::is_specialized");
36 static_assert(std::numeric_limits<const T>::is_specialized,
37 "std::numeric_limits<const T>::is_specialized");
38 static_assert(std::numeric_limits<volatile T>::is_specialized,
39 "std::numeric_limits<volatile T>::is_specialized");
40 static_assert(std::numeric_limits<const volatile T>::is_specialized,
41 "std::numeric_limits<const volatile T>::is_specialized");
45 int main(int, char**)
47 types::for_each(types::arithmetic_types(), Test());
49 static_assert(!std::numeric_limits<std::complex<double> >::is_specialized,
50 "!std::numeric_limits<std::complex<double> >::is_specialized");
52 return 0;