• 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 default ctor
11 
12 #include <bitset>
13 #include <cassert>
14 
15 #include "test_macros.h"
16 
17 template <std::size_t N>
test_default_ctor()18 void test_default_ctor()
19 {
20     {
21         TEST_CONSTEXPR std::bitset<N> v1;
22         assert(v1.size() == N);
23         for (std::size_t i = 0; i < N; ++i)
24             assert(v1[i] == false);
25     }
26 #if TEST_STD_VER >= 11
27     {
28         constexpr std::bitset<N> v1;
29         static_assert(v1.size() == N, "");
30     }
31 #endif
32 }
33 
34 
main()35 int main()
36 {
37     test_default_ctor<0>();
38     test_default_ctor<1>();
39     test_default_ctor<31>();
40     test_default_ctor<32>();
41     test_default_ctor<33>();
42     test_default_ctor<63>();
43     test_default_ctor<64>();
44     test_default_ctor<65>();
45     test_default_ctor<1000>();
46 }
47