| 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 |
// UNSUPPORTED: c++03, c++11, c++14 |
| 10 |
|
| 11 |
// <experimental/simd> |
| 12 |
// |
| 13 |
// [simd.mask.class] |
| 14 |
// explicit simd_mask(value_type) noexcept; |
| 15 |
|
| 16 |
#include "../test_utils.h" |
| 17 |
#include <experimental/simd> |
| 18 |
|
| 19 |
namespace ex = std::experimental::parallelism_v2; |
| 20 |
|
| 21 |
template <class T, std::size_t> |
| 22 |
struct CheckMaskBroadcastCtor { |
| 23 |
template <class SimdAbi> |
| 24 |
void operator()() { |
| 25 |
constexpr size_t array_size = ex::simd_size_v<T, SimdAbi>; |
| 26 |
const ex::simd_mask<T, SimdAbi> mask_ctor_from_broadcast(false); |
| 27 |
const std::array<bool, array_size> expected_value{}; |
| 28 |
assert_simd_mask_values_equal(mask_ctor_from_broadcast, expected_value); |
| 29 |
} |
| 30 |
}; |
| 31 |
|
| 32 |
int main(int, char**) { |
| 33 |
test_all_simd_abi<CheckMaskBroadcastCtor>(); |
| 34 |
return 0; |
| 35 |
} |