[PowerPC] Collect some CallLowering arguments into a struct. [NFC]
[llvm-project.git] / libcxx / test / std / containers / sequences / array / array.tuple / get_const.pass.cpp
blobb22a76185b6fcd678abf4fd68c58ad40abd91207
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 // std::array is explicitly allowed to be initialized with A a = { init-list };.
19 // Disable the missing braces warning for this reason.
20 #include "disable_missing_braces_warning.h"
22 int main(int, char**)
25 typedef double T;
26 typedef std::array<T, 3> C;
27 const C c = {1, 2, 3.5};
28 assert(std::get<0>(c) == 1);
29 assert(std::get<1>(c) == 2);
30 assert(std::get<2>(c) == 3.5);
32 #if TEST_STD_VER > 11
34 typedef double T;
35 typedef std::array<T, 3> C;
36 constexpr const C c = {1, 2, 3.5};
37 static_assert(std::get<0>(c) == 1, "");
38 static_assert(std::get<1>(c) == 2, "");
39 static_assert(std::get<2>(c) == 3.5, "");
41 #endif
43 return 0;