]>
git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/testsuite/tr2/dynamic_bitset/pr87784.cc
1 // Copyright (C) 2018-2023 Free Software Foundation, Inc.
3 // This file is part of the GNU ISO C++ Library. This library is free
4 // software; you can redistribute it and/or modify it under the
5 // terms of the GNU General Public License as published by the
6 // Free Software Foundation; either version 3, or (at your option)
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License along
15 // with this library; see the file COPYING3. If not see
16 // <http://www.gnu.org/licenses/>.
18 // { dg-do run { target c++11 } }
20 #include <tr2/dynamic_bitset>
21 #include <testsuite_hooks.h>
26 std::tr2::dynamic_bitset
<unsigned> b
;
27 VERIFY( b
.size() == 0 );
28 VERIFY( b
.find_first() == b
.size() );
30 VERIFY( b
.size() == 1 );
31 VERIFY( b
.find_first() == b
.size() );
33 VERIFY( b
.size() == 2 );
34 VERIFY( b
.find_first() == b
.size() );
37 VERIFY( b
.size() == 3 );
38 VERIFY( b
.find_first() == b
.size() - 1 );
40 VERIFY( b
.size() == 4 );
41 VERIFY( b
.find_first() == b
.size() - 2 );
43 VERIFY( b
.size() == 5 );
44 VERIFY( b
.find_first() == b
.size() - 3 );
47 VERIFY( b
.size() == 0 );
48 VERIFY( b
.find_first() == b
.size() );
50 VERIFY( b
.size() == 1 );
51 VERIFY( b
.find_first() == 0 );
53 VERIFY( b
.size() == 2 );
54 VERIFY( b
.find_first() == 0 );
56 VERIFY( b
.size() == 3 );
57 VERIFY( b
.find_first() == 0 );
61 VERIFY( b
.size() == b
.bits_per_block
);
62 VERIFY( b
.find_first() == 1 );
64 VERIFY( b
.find_first() == 2 );
66 VERIFY( b
.find_first() == 5 );
68 VERIFY( b
.find_first() == 11 );
69 VERIFY( b
.size() == b
.bits_per_block
);