]>
git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/testsuite/23_containers/bitset/cons/50268.cc
1 // { dg-do run { target c++11 } }
3 // Copyright (C) 2011-2019 Free Software Foundation, Inc.
5 // This file is part of the GNU ISO C++ Library. This library is free
6 // software; you can redistribute it and/or modify it under the
7 // terms of the GNU General Public License as published by the
8 // Free Software Foundation; either version 3, or (at your option)
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License along
17 // with this library; see the file COPYING3. If not see
18 // <http://www.gnu.org/licenses/>.
21 #include <testsuite_hooks.h>
26 std::bitset
<1> b1(3ULL);
27 VERIFY( b1
.count() == 1ULL );
29 std::bitset
<3> b2(30ULL);
30 VERIFY( b2
.count() == 2ULL );
32 std::bitset
<6> b3(300ULL);
33 VERIFY( b3
.count() == 3ULL );
35 std::bitset
<9> b4(3000ULL);
36 VERIFY( b4
.count() == 5ULL );
38 std::bitset
<16> b5(300000ULL);
39 VERIFY( b5
.count() == 7ULL );
41 std::bitset
<24> b6(30000000ULL);
42 VERIFY( b6
.count() == 9ULL );
44 std::bitset
<32> b7(30000000000ULL);
45 VERIFY( b7
.count() == 13ULL );
47 std::bitset
<37> b8(3000000000000ULL);
48 VERIFY( b8
.count() == 18ULL );
50 std::bitset
<40> b9(30000000000000ULL);
51 VERIFY( b9
.count() == 16ULL );
53 std::bitset
<45> b10(30000000000000ULL);
54 VERIFY( b10
.count() == 20ULL );
56 std::bitset
<64> b11(30000000000000ULL);
57 VERIFY( b11
.count() == 20ULL );
59 std::bitset
<100> b12(30000000000000ULL);
60 VERIFY( b12
.count() == 20ULL );
62 std::bitset
<200> b13(30000000000000ULL);
63 VERIFY( b13
.count() == 20ULL );
65 std::bitset
<45> b14(18446744073709551615ULL);
66 VERIFY( b14
.count() == 45ULL );
68 std::bitset
<64> b15(18446744073709551615ULL);
69 VERIFY( b15
.count() == 64ULL );
71 std::bitset
<100> b16(18446744073709551615ULL);
72 VERIFY( b16
.count() == 64ULL );
74 std::bitset
<200> b17(18446744073709551615ULL);
75 VERIFY( b17
.count() == 64ULL );