[AMDGPU] Mark AGPR tuple implicit in the first instr of AGPR spills. (#115285)
[llvm-project.git] / libcxx / test / std / utilities / template.bitset / bitset.cons / ull_ctor.pass.cpp
blobc3c30490d90a23a2dc6584de53420841b97f7c95
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 //===----------------------------------------------------------------------===//
9 // bitset(unsigned long long val); // constexpr since C++23
11 #include <bitset>
12 #include <cassert>
13 #include <algorithm> // for 'min' and 'max'
14 #include <cstddef>
16 #include "test_macros.h"
18 TEST_MSVC_DIAGNOSTIC_IGNORED(6294) // Ill-defined for-loop: initial condition does not satisfy test. Loop body not executed.
20 template <std::size_t N>
21 TEST_CONSTEXPR_CXX23 void test_val_ctor()
24 TEST_CONSTEXPR std::bitset<N> v(0xAAAAAAAAAAAAAAAAULL);
25 assert(v.size() == N);
26 std::size_t M = std::min<std::size_t>(v.size(), 64);
27 for (std::size_t i = 0; i < M; ++i)
28 assert(v[i] == ((i & 1) != 0));
29 for (std::size_t i = M; i < v.size(); ++i)
30 assert(v[i] == false);
32 #if TEST_STD_VER >= 11
34 constexpr std::bitset<N> v(0xAAAAAAAAAAAAAAAAULL);
35 static_assert(v.size() == N, "");
37 #endif
40 TEST_CONSTEXPR_CXX23 bool test() {
41 test_val_ctor<0>();
42 test_val_ctor<1>();
43 test_val_ctor<31>();
44 test_val_ctor<32>();
45 test_val_ctor<33>();
46 test_val_ctor<63>();
47 test_val_ctor<64>();
48 test_val_ctor<65>();
49 test_val_ctor<1000>();
51 return true;
54 int main(int, char**)
56 test();
57 #if TEST_STD_VER > 20
58 static_assert(test());
59 #endif
61 return 0;