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