• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 // test bitset<N>& set();
10 
11 #include <bitset>
12 #include <cassert>
13 #include <cstddef>
14 
15 #include "test_macros.h"
16 
17 template <std::size_t N>
test_set_all()18 void test_set_all() {
19     std::bitset<N> v;
20     v.set();
21     for (std::size_t i = 0; i < v.size(); ++i)
22         assert(v[i]);
23 }
24 
main(int,char **)25 int main(int, char**) {
26     test_set_all<0>();
27     test_set_all<1>();
28     test_set_all<31>();
29     test_set_all<32>();
30     test_set_all<33>();
31     test_set_all<63>();
32     test_set_all<64>();
33     test_set_all<65>();
34     test_set_all<1000>();
35 
36     return 0;
37 }
38