From 291549d43e823f163fa9961e42a751b5ce0d57fb Mon Sep 17 00:00:00 2001 From: Matthias Kretz Date: Thu, 25 May 2023 12:07:45 +0200 Subject: [PATCH] libstdc++: Fix test assumptions on long and long double Expect that long might not fit into the long double mantissa bits. Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: * testsuite/experimental/simd/tests/operator_cvt.cc: Make long double <-> (u)long conversion tests conditional on sizeof(long double) and sizeof(long). --- .../experimental/simd/tests/operator_cvt.cc | 30 +++++++++++++++---- 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/operator_cvt.cc b/libstdc++-v3/testsuite/experimental/simd/tests/operator_cvt.cc index c1acfdf10e08..9b6cb38ff826 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/operator_cvt.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/operator_cvt.cc @@ -219,8 +219,6 @@ template binary_op_return_type(); binary_op_return_type(); binary_op_return_type(); - binary_op_return_type(); - binary_op_return_type(); binary_op_return_type(); binary_op_return_type(); @@ -230,8 +228,6 @@ template binary_op_return_type, ushort>(); binary_op_return_type, int>(); binary_op_return_type, uint>(); - binary_op_return_type, long>(); - binary_op_return_type, ulong>(); binary_op_return_type, float>(); binary_op_return_type, double>(); binary_op_return_type, vf64>(); @@ -244,8 +240,6 @@ template binary_op_return_type, ushort>(); binary_op_return_type, int>(); binary_op_return_type, uint>(); - binary_op_return_type, long>(); - binary_op_return_type, ulong>(); binary_op_return_type, float>(); binary_op_return_type, double>(); @@ -257,6 +251,24 @@ template VERIFY((is_substitution_failure, ullong>)); VERIFY((is_substitution_failure, llong>)); VERIFY((is_substitution_failure, ullong>)); + if constexpr (sizeof(long) == sizeof(llong)) + { + VERIFY((is_substitution_failure)); + VERIFY((is_substitution_failure)); + VERIFY((is_substitution_failure, long>)); + VERIFY((is_substitution_failure, ulong>)); + VERIFY((is_substitution_failure, long>)); + VERIFY((is_substitution_failure, ulong>)); + } + else + { + binary_op_return_type(); + binary_op_return_type(); + binary_op_return_type, long>(); + binary_op_return_type, ulong>(); + binary_op_return_type, long>(); + binary_op_return_type, ulong>(); + } } else { @@ -266,6 +278,12 @@ template binary_op_return_type, ullong>(); binary_op_return_type, llong>(); binary_op_return_type, ullong>(); + binary_op_return_type(); + binary_op_return_type(); + binary_op_return_type, long>(); + binary_op_return_type, ulong>(); + binary_op_return_type, long>(); + binary_op_return_type, ulong>(); } VERIFY((is_substitution_failure, vldouble>)); -- 2.47.2