[PowerPC][NFC] Cleanup PPCCTRLoopsVerify pass
[llvm-project.git] / libcxx / test / std / containers / sequences / array / array.tuple / tuple_element.pass.cpp
blobfb7aa7cf02ca5f7f303f4bb2c6836934b71399b4
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 // tuple_element<I, array<T, N> >::type
13 #include <array>
14 #include <type_traits>
16 #include "test_macros.h"
18 template <class T>
19 void test()
22 typedef T Exp;
23 typedef std::array<T, 3> C;
24 static_assert((std::is_same<typename std::tuple_element<0, C>::type, Exp>::value), "");
25 static_assert((std::is_same<typename std::tuple_element<1, C>::type, Exp>::value), "");
26 static_assert((std::is_same<typename std::tuple_element<2, C>::type, Exp>::value), "");
29 typedef T const Exp;
30 typedef std::array<T, 3> const C;
31 static_assert((std::is_same<typename std::tuple_element<0, C>::type, Exp>::value), "");
32 static_assert((std::is_same<typename std::tuple_element<1, C>::type, Exp>::value), "");
33 static_assert((std::is_same<typename std::tuple_element<2, C>::type, Exp>::value), "");
36 typedef T volatile Exp;
37 typedef std::array<T, 3> volatile C;
38 static_assert((std::is_same<typename std::tuple_element<0, C>::type, Exp>::value), "");
39 static_assert((std::is_same<typename std::tuple_element<1, C>::type, Exp>::value), "");
40 static_assert((std::is_same<typename std::tuple_element<2, C>::type, Exp>::value), "");
43 typedef T const volatile Exp;
44 typedef std::array<T, 3> const volatile C;
45 static_assert((std::is_same<typename std::tuple_element<0, C>::type, Exp>::value), "");
46 static_assert((std::is_same<typename std::tuple_element<1, C>::type, Exp>::value), "");
47 static_assert((std::is_same<typename std::tuple_element<2, C>::type, Exp>::value), "");
51 int main(int, char**)
53 test<double>();
54 test<int>();
56 return 0;