[RISCV] Fix mgather -> riscv.masked.strided.load combine not extending indices (...
[llvm-project.git] / libcxx / test / std / containers / sequences / array / array.tuple / get_const.pass.cpp
blob5fc080b8efc8639d77a3842f809abae244c3fddc
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 <size_t I, class T, size_t N> const T& get(const array<T, N>& a);
13 #include <array>
14 #include <cassert>
16 #include "test_macros.h"
18 TEST_CONSTEXPR_CXX14 bool tests()
21 std::array<double, 1> const array = {3.3};
22 assert(std::get<0>(array) == 3.3);
25 std::array<double, 2> const array = {3.3, 4.4};
26 assert(std::get<0>(array) == 3.3);
27 assert(std::get<1>(array) == 4.4);
30 std::array<double, 3> const array = {3.3, 4.4, 5.5};
31 assert(std::get<0>(array) == 3.3);
32 assert(std::get<1>(array) == 4.4);
33 assert(std::get<2>(array) == 5.5);
36 std::array<double, 1> const array = {3.3};
37 static_assert(std::is_same<double const&, decltype(std::get<0>(array))>::value, "");
40 return true;
43 int main(int, char**)
45 tests();
46 #if TEST_STD_VER >= 14
47 static_assert(tests(), "");
48 #endif
49 return 0;