[RISCV] Fix mgather -> riscv.masked.strided.load combine not extending indices (...
[llvm-project.git] / libcxx / test / std / containers / sequences / array / array.size / size.pass.cpp
blobd39edd1206413610b18bf880eb8e26efacd807e7
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 // <array>
11 // template <class T, size_t N> constexpr size_type array<T,N>::size();
13 #include <array>
14 #include <cassert>
16 #include "test_macros.h"
18 int main(int, char**)
21 typedef double T;
22 typedef std::array<T, 3> C;
23 C c = {1, 2, 3.5};
24 assert(c.size() == 3);
25 assert(c.max_size() == 3);
26 assert(!c.empty());
29 typedef double T;
30 typedef std::array<T, 0> C;
31 C c = {};
32 assert(c.size() == 0);
33 assert(c.max_size() == 0);
34 assert(c.empty());
36 #if TEST_STD_VER >= 11
38 typedef double T;
39 typedef std::array<T, 3> C;
40 constexpr C c = {1, 2, 3.5};
41 static_assert(c.size() == 3, "");
42 static_assert(c.max_size() == 3, "");
43 static_assert(!c.empty(), "");
46 typedef double T;
47 typedef std::array<T, 0> C;
48 constexpr C c = {};
49 static_assert(c.size() == 0, "");
50 static_assert(c.max_size() == 0, "");
51 static_assert(c.empty(), "");
53 #endif
55 return 0;