[RISCV] Fix mgather -> riscv.masked.strided.load combine not extending indices (...
[llvm-project.git] / libcxx / test / std / containers / sequences / vector.bool / compare.pass.cpp
blob0f818029c1ff980dc0a123a238fbf75c8c9474b1
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 // bool operator==( const vector& lhs, const vector& rhs );
12 // bool operator!=( const vector& lhs, const vector& rhs );
13 // bool operator< ( const vector& lhs, const vector& rhs );
14 // bool operator<=( const vector& lhs, const vector& rhs );
15 // bool operator> ( const vector& lhs, const vector& rhs );
16 // bool operator>=( const vector& lhs, const vector& rhs );
18 #include <vector>
19 #include <cassert>
21 #include "test_comparisons.h"
23 TEST_CONSTEXPR_CXX20 bool test() {
24 typedef std::vector<bool> VB;
26 const VB v1, v2;
27 assert(testComparisons(v1, v2, true, false));
30 const VB v1(1, true);
31 const VB v2(1, true);
32 assert(testComparisons(v1, v2, true, false));
35 const VB v1(1, false);
36 const VB v2(1, true);
37 assert(testComparisons(v1, v2, false, true));
40 const VB v1, v2(1, true);
41 assert(testComparisons(v1, v2, false, true));
44 bool items1[3] = {false, true, false};
45 bool items2[3] = {false, true, true};
46 const VB v1(items1, items1 + 3);
47 const VB v2(items2, items2 + 3);
48 assert(testComparisons(v1, v2, false, true));
51 bool items1[3] = {false, false, false};
52 bool items2[3] = {false, true, false};
53 const VB v1(items1, items1 + 3);
54 const VB v2(items2, items2 + 3);
55 assert(testComparisons(v1, v2, false, true));
58 bool items1[2] = {false, true};
59 bool items2[3] = {false, true, false};
60 const VB v1(items1, items1 + 2);
61 const VB v2(items2, items2 + 3);
62 assert(testComparisons(v1, v2, false, true));
65 bool items[3] = {false, true, false};
66 const VB v1(items, items + 3);
67 const VB v2(1, true);
68 assert(testComparisons(v1, v2, false, true));
71 assert( (std::vector<bool>() == std::vector<bool>()));
72 assert(!(std::vector<bool>() != std::vector<bool>()));
73 assert(!(std::vector<bool>() < std::vector<bool>()));
74 assert( (std::vector<bool>() <= std::vector<bool>()));
75 assert(!(std::vector<bool>() > std::vector<bool>()));
76 assert( (std::vector<bool>() >= std::vector<bool>()));
79 return true;
82 int main(int, char**) {
83 test();
84 #if TEST_STD_VER > 17
85 static_assert(test());
86 #endif
88 return 0;