1 //===----------------------------------------------------------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 // test bitset<N>& set();
11 
12 #include <bitset>
13 #include <cassert>
14 
15 #pragma clang diagnostic ignored "-Wtautological-compare"
16 
17 template <std::size_t N>
18 void test_set_all()
19 {
20     std::bitset<N> v;
21     v.set();
22     for (std::size_t i = 0; i < N; ++i)
23         assert(v[i]);
24 }
25 
26 int main()
27 {
28     test_set_all<0>();
29     test_set_all<1>();
30     test_set_all<31>();
31     test_set_all<32>();
32     test_set_all<33>();
33     test_set_all<63>();
34     test_set_all<64>();
35     test_set_all<65>();
36     test_set_all<1000>();
37 }
38