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>& reset(); 10 11 #include <bitset> 12 #include <cassert> 13 #include <cstddef> 14 15 #include "test_macros.h" 16 17 template <std::size_t N> test_reset_all()18void test_reset_all() { 19 std::bitset<N> v; 20 v.set(); 21 v.reset(); 22 for (std::size_t i = 0; i < v.size(); ++i) 23 assert(!v[i]); 24 } 25 main(int,char **)26int main(int, char**) { 27 test_reset_all<0>(); 28 test_reset_all<1>(); 29 test_reset_all<31>(); 30 test_reset_all<32>(); 31 test_reset_all<33>(); 32 test_reset_all<63>(); 33 test_reset_all<64>(); 34 test_reset_all<65>(); 35 test_reset_all<1000>(); 36 37 return 0; 38 } 39