1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
12 // bool operator==(const bitset<N>& rhs) const;
13 // bool operator!=(const bitset<N>& rhs) const;
16 #include <type_traits>
20 #include "test_macros.h"
22 #if defined(TEST_COMPILER_CLANG)
23 #pragma clang diagnostic ignored "-Wtautological-compare"
24 #elif defined(TEST_COMPILER_C1XX)
25 #pragma warning(disable: 6294) // Ill-defined for-loop: initial condition does not satisfy test. Loop body not executed.
28 template <std::size_t N>
33 for (std::size_t i = 0; i < N; ++i)
34 v[i] = static_cast<bool>(std::rand() & 1);
38 template <std::size_t N>
41 const std::bitset<N> v1 = make_bitset<N>();
42 std::bitset<N> v2 = v1;
44 const bool greater_than_0 = std::integral_constant<bool, (N > 0)>::value; // avoid compiler warnings
62 test_equality<1000>();