diff --git a/libstdc++-v3/testsuite/std/simd/traits_impl.cc b/libstdc++-v3/testsuite/std/simd/traits_impl.cc index a264bd5f140..06bf6d5be25 100644 --- a/libstdc++-v3/testsuite/std/simd/traits_impl.cc +++ b/libstdc++-v3/testsuite/std/simd/traits_impl.cc @@ -9,7 +9,9 @@ namespace simd = std::simd; +#ifdef __STDCPP_FLOAT16_T__ using std::float16_t; +#endif using std::float32_t; using std::float64_t; @@ -17,7 +19,11 @@ using namespace std::simd; void test() { - template for (auto t : {float(), double(), float16_t(), float32_t(), float64_t()}) + template for (auto t : {float(), double(), +#ifdef __STDCPP_FLOAT16_T__ + float16_t(), +#endif + float32_t(), float64_t()}) { using T = decltype(t); static_assert(__vectorizable); @@ -25,7 +31,9 @@ void test() static_assert(!__vectorizable); static_assert(!__vectorizable); +#ifdef __STDCPP_BFLOAT16_T__ static_assert(!__vectorizable); +#endif template for (constexpr int N : {1, 2, 4, 8}) { @@ -82,8 +90,10 @@ void test() static_assert( __value_preserving_convertible_to); static_assert(!__value_preserving_convertible_to); +#ifdef __STDCPP_FLOAT16_T__ static_assert(__explicitly_convertible_to); static_assert(__explicitly_convertible_to); +#endif static_assert(__constexpr_wrapper_like>); static_assert(__constexpr_wrapper_like>); @@ -95,7 +105,9 @@ void test() static_assert(!__broadcast_constructible); static_assert(__broadcast_constructible), float>); +#ifdef __STDCPP_FLOAT16_T__ static_assert(__broadcast_constructible), std::float16_t>); +#endif static_assert(__higher_rank_than); @@ -112,7 +124,9 @@ void test() static_assert(__higher_rank_than); static_assert(__higher_rank_than); +#ifdef __STDCPP_FLOAT16_T__ static_assert(__higher_rank_than); +#endif static_assert(__higher_rank_than); static_assert(__higher_rank_than); static_assert(__higher_rank_than);