[RISCV] Fix mgather -> riscv.masked.strided.load combine not extending indices (...
[llvm-project.git] / libcxx / test / std / utilities / meta / meta.unary.prop.query / rank.pass.cpp
blob6c2eecb86db7c4aa836262570187d7369fd4bda2
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 // type_traits
11 // rank
13 #include <type_traits>
15 #include "test_macros.h"
17 template <class T, unsigned A>
18 void test_rank()
20 static_assert( std::rank<T>::value == A, "");
21 static_assert( std::rank<const T>::value == A, "");
22 static_assert( std::rank<volatile T>::value == A, "");
23 static_assert( std::rank<const volatile T>::value == A, "");
24 #if TEST_STD_VER > 14
25 static_assert( std::rank_v<T> == A, "");
26 static_assert( std::rank_v<const T> == A, "");
27 static_assert( std::rank_v<volatile T> == A, "");
28 static_assert( std::rank_v<const volatile T> == A, "");
29 #endif
32 class Class
34 public:
35 ~Class();
38 int main(int, char**)
40 test_rank<void, 0>();
41 test_rank<int&, 0>();
42 test_rank<Class, 0>();
43 test_rank<int*, 0>();
44 test_rank<const int*, 0>();
45 test_rank<int, 0>();
46 test_rank<double, 0>();
47 test_rank<bool, 0>();
48 test_rank<unsigned, 0>();
50 test_rank<char[3], 1>();
51 test_rank<char[][3], 2>();
52 test_rank<char[][4][3], 3>();
54 return 0;