[RISCV] Fix mgather -> riscv.masked.strided.load combine not extending indices (...
[llvm-project.git] / libcxx / test / std / containers / sequences / array / aggregate.pass.cpp
blob9db25a9231bca19d8e96d9a48a07f9017d52b364
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 // Make sure std::array is an aggregate type.
10 // We can only check this in C++17 and above, because we don't have the
11 // trait before that.
12 // UNSUPPORTED: c++03, c++11, c++14
14 #include <array>
15 #include <type_traits>
17 template <typename T>
18 void check_aggregate()
20 static_assert(std::is_aggregate<std::array<T, 0> >::value, "");
21 static_assert(std::is_aggregate<std::array<T, 1> >::value, "");
22 static_assert(std::is_aggregate<std::array<T, 2> >::value, "");
23 static_assert(std::is_aggregate<std::array<T, 3> >::value, "");
24 static_assert(std::is_aggregate<std::array<T, 4> >::value, "");
27 struct Empty { };
28 struct Trivial { int i; int j; };
29 struct NonTrivial {
30 int i; int j;
31 NonTrivial(NonTrivial const&) { }
34 int main(int, char**)
36 check_aggregate<char>();
37 check_aggregate<int>();
38 check_aggregate<long>();
39 check_aggregate<float>();
40 check_aggregate<double>();
41 check_aggregate<long double>();
42 check_aggregate<Empty>();
43 check_aggregate<Trivial>();
44 check_aggregate<NonTrivial>();
46 return 0;