[RISCV] Fix mgather -> riscv.masked.strided.load combine not extending indices (...
[llvm-project.git] / libcxx / test / std / containers / sequences / vector.bool / push_back.pass.cpp
blob25f8fb6b29dfe03419927f2a12ed245dde904414
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>
10 // vector<bool>
12 // void push_back(const value_type& x);
14 #include <vector>
15 #include <cassert>
16 #include <cstddef>
18 #include "test_macros.h"
19 #include "min_allocator.h"
21 TEST_CONSTEXPR_CXX20 bool tests()
24 bool a[] = {0, 1, 1, 0, 1, 0, 0};
25 const unsigned N = sizeof(a)/sizeof(a[0]);
26 std::vector<bool> c;
27 for (unsigned i = 0; i < N; ++i)
29 c.push_back(a[i]);
30 assert(c.size() == i+1);
31 for (std::size_t j = 0; j < c.size(); ++j)
32 assert(c[j] == a[j]);
35 #if TEST_STD_VER >= 11
37 bool a[] = {0, 1, 1, 0, 1, 0, 0};
38 const unsigned N = sizeof(a)/sizeof(a[0]);
39 std::vector<bool, min_allocator<bool>> c;
40 for (unsigned i = 0; i < N; ++i)
42 c.push_back(a[i]);
43 assert(c.size() == i+1);
44 for (std::size_t j = 0; j < c.size(); ++j)
45 assert(c[j] == a[j]);
48 #endif
50 return true;
53 int main(int, char**)
55 tests();
56 #if TEST_STD_VER > 17
57 static_assert(tests());
58 #endif
59 return 0;