[PowerPC][NFC] Cleanup PPCCTRLoopsVerify pass
[llvm-project.git] / libcxx / test / std / utilities / template.bitset / bitset.members / op_or_eq.pass.cpp
blobbe8f9d8c9f4632897cf6f3508a0a4dae6ce2e06c
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 // test bitset<N>& operator|=(const bitset<N>& rhs);
11 #include <bitset>
12 #include <cassert>
13 #include <cstddef>
14 #include <vector>
16 #include "../bitset_test_cases.h"
17 #include "test_macros.h"
19 template <std::size_t N>
20 void test_op_or_eq() {
21 std::vector<std::bitset<N> > const cases = get_test_cases<N>();
22 for (std::size_t c1 = 0; c1 != cases.size(); ++c1) {
23 for (std::size_t c2 = 0; c2 != cases.size(); ++c2) {
24 std::bitset<N> v1 = cases[c1];
25 std::bitset<N> v2 = cases[c2];
26 std::bitset<N> v3 = v1;
27 v1 |= v2;
28 for (std::size_t i = 0; i < v1.size(); ++i)
29 assert(v1[i] == (v3[i] || v2[i]));
34 int main(int, char**) {
35 test_op_or_eq<0>();
36 test_op_or_eq<1>();
37 test_op_or_eq<31>();
38 test_op_or_eq<32>();
39 test_op_or_eq<33>();
40 test_op_or_eq<63>();
41 test_op_or_eq<64>();
42 test_op_or_eq<65>();
43 test_op_or_eq<1000>();
45 return 0;