[RISCV] Fix mgather -> riscv.masked.strided.load combine not extending indices (...
[llvm-project.git] / libcxx / test / std / utilities / meta / meta.help / integral_constant.pass.cpp
blobf312acad657683d5c0043e66ae60ac5e84a6763a
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 // type_traits
11 // integral_constant
13 #include <type_traits>
14 #include <cassert>
16 #include "test_macros.h"
18 int main(int, char**)
20 typedef std::integral_constant<int, 5> _5;
21 static_assert(_5::value == 5, "");
22 static_assert((std::is_same<_5::value_type, int>::value), "");
23 static_assert((std::is_same<_5::type, _5>::value), "");
24 #if TEST_STD_VER >= 11
25 static_assert((_5() == 5), "");
26 #endif
27 assert(_5() == 5);
30 #if TEST_STD_VER > 11
31 static_assert ( _5{}() == 5, "" );
32 static_assert ( std::true_type{}(), "" );
33 #endif
35 static_assert(std::false_type::value == false, "");
36 static_assert((std::is_same<std::false_type::value_type, bool>::value), "");
37 static_assert((std::is_same<std::false_type::type, std::false_type>::value), "");
39 static_assert(std::true_type::value == true, "");
40 static_assert((std::is_same<std::true_type::value_type, bool>::value), "");
41 static_assert((std::is_same<std::true_type::type, std::true_type>::value), "");
43 std::false_type f1;
44 std::false_type f2 = f1;
45 assert(!f2);
47 std::true_type t1;
48 std::true_type t2 = t1;
49 assert(t2);
51 return 0;