• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #if defined(__clang__)
16 #pragma clang diagnostic ignored "-Wtautological-compare"
17 #endif
18 
19 template <std::size_t N>
test_set_all()20 void test_set_all()
21 {
22     std::bitset<N> v;
23     v.set();
24     for (std::size_t i = 0; i < N; ++i)
25         assert(v[i]);
26 }
27 
main()28 int main()
29 {
30     test_set_all<0>();
31     test_set_all<1>();
32     test_set_all<31>();
33     test_set_all<32>();
34     test_set_all<33>();
35     test_set_all<63>();
36     test_set_all<64>();
37     test_set_all<65>();
38     test_set_all<1000>();
39 }
40