[RISCV] Fix mgather -> riscv.masked.strided.load combine not extending indices (...
[llvm-project.git] / libcxx / test / std / containers / sequences / vector.bool / const_reference.pass.cpp
blobc2cb7f0298ddbe8992ea8f497eaaeaba66980993
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 // <vector>
11 #include <cassert>
12 #include <vector>
14 #include "test_macros.h"
16 TEST_CONSTEXPR_CXX20 bool test() {
17 using CRefT = std::vector<bool>::const_reference;
18 #if !defined(_LIBCPP_VERSION) || defined(_LIBCPP_ABI_BITSET_VECTOR_BOOL_CONST_SUBSCRIPT_RETURN_BOOL)
19 ASSERT_SAME_TYPE(CRefT, bool);
20 #else
21 ASSERT_SAME_TYPE(CRefT, std::__bit_const_reference<std::vector<bool> >);
22 std::vector<bool> vec;
23 vec.push_back(true);
24 CRefT ref = vec[0];
25 assert(ref);
26 vec[0] = false;
27 assert(!ref);
28 #endif
30 return true;
33 int main(int, char**) {
34 test();
35 #if TEST_STD_VER > 17
36 static_assert(test());
37 #endif
39 return 0;