[PowerPC][NFC] Cleanup PPCCTRLoopsVerify pass
[llvm-project.git] / libcxx / test / std / utilities / template.bitset / bitset.members / right_shift.pass.cpp
blob46eb17d1fa8ddec5e886ae67e3960311c921c0d6
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>>(size_t pos) const;
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_right_shift() {
21 std::vector<std::bitset<N> > const cases = get_test_cases<N>();
22 for (std::size_t c = 0; c != cases.size(); ++c) {
23 for (std::size_t s = 0; s <= N+1; ++s) {
24 std::bitset<N> v1 = cases[c];
25 std::bitset<N> v2 = v1;
26 assert((v1 >>= s) == (v2 >> s));
31 int main(int, char**) {
32 test_right_shift<0>();
33 test_right_shift<1>();
34 test_right_shift<31>();
35 test_right_shift<32>();
36 test_right_shift<33>();
37 test_right_shift<63>();
38 test_right_shift<64>();
39 test_right_shift<65>();
40 test_right_shift<1000>();
42 return 0;