On 03/05/2019 20:25, Jonathan Wakely wrote:
> On 03/05/19 14:34 +0000, Szabolcs Nagy wrote:
>> there is still an execution failure, but that's not
>> related to copysign: proj(i*inf) returns i*inf instead of inf
>> i haven't figured out why:
>>
>> /work/b/src/gcc/libstdc++-v3/testsuite/26_numerics/complex/proj.cc:105: void 
>> test01(): Assertion 'eq( std::proj(c0p) ,
>> std::complex<double>(pinf, +0.0) )' failed.
>> FAIL: 26_numerics/complex/proj.cc execution test
> 
> If std::copysign isn't avilable then we only provide the generic
> std::proj which doesn't support infinities, so all the tests using
> positive or negative infinity will give the wrong answer.
> 
> The r270759 change doesn't actually use std::copysign, only
> __builtin_copysign, but if the compiler doesn't expand that then it
> still requires libc to provide copysign. If autoconf decides copysign
> isn't available, std::proj doesn't support infinities.
> 
> I'm not sure whether to XFAIL the test in that case, or just make the
> tests for infinities conditional on the necessary support in libc e.g.

it seems newlib does not have full c99 math support on
aarch64 because several long double math functions are
missing (including copysignl).

i think it's better to xfail { ! copysignl } than hiding
the failure with ifdefs (but it requires a copysignl check
in the test system or a more general c99 math check)


> 
> --- a/libstdc++-v3/testsuite/26_numerics/complex/proj.cc
> +++ b/libstdc++-v3/testsuite/26_numerics/complex/proj.cc
> @@ -101,6 +101,7 @@ test01()
>   VERIFY( eq( std::proj(cqq)  , cqq ) );
>   VERIFY( eq( std::proj(-cqq) , -cqq ) );
> 
> +#ifdef _GLIBCXX_USE_C99_MATH_TR1
>   const std::complex<double> c0p(0, pinf);
>   VERIFY( eq( std::proj(c0p)  , std::complex<double>(pinf, +0.0) ) );
>   VERIFY( eq( std::proj(-c0p) , std::complex<double>(pinf, -0.0) ) );
> @@ -164,6 +165,7 @@ test01()
>   const std::complex<double> cnp(ninf, pinf);
>   VERIFY( eq( std::proj(cnp)  , std::complex<double>(pinf, +0.0) ) );
>   VERIFY( eq( std::proj(-cnp) , std::complex<double>(pinf, -0.0) ) );
> +#endif
> }
> 
> void
> @@ -215,6 +217,7 @@ test02()
>   VERIFY( eq( std::proj(cqq)  , cqq ) );
>   VERIFY( eq( std::proj(-cqq) , -cqq ) );
> 
> +#ifdef _GLIBCXX_USE_C99_MATH_TR1
>   const std::complex<float> c0p(0, pinf);
>   VERIFY( eq( std::proj(c0p)  , std::complex<float>(pinf, +0.0) ) );
>   VERIFY( eq( std::proj(-c0p) , std::complex<float>(pinf, -0.0) ) );
> @@ -278,6 +281,7 @@ test02()
>   const std::complex<float> cnp(ninf, pinf);
>   VERIFY( eq( std::proj(cnp)  , std::complex<float>(pinf, +0.0) ) );
>   VERIFY( eq( std::proj(-cnp) , std::complex<float>(pinf, -0.0) ) );
> +#endif
> }
> 
> void
> @@ -329,6 +333,7 @@ test03()
>   VERIFY( eq( std::proj(cqq)  , cqq ) );
>   VERIFY( eq( std::proj(-cqq) , -cqq ) );
> 
> +#ifdef _GLIBCXX_USE_C99_MATH_TR1
>   const std::complex<long double> c0p(0, pinf);
>   VERIFY( eq( std::proj(c0p)  , std::complex<long double>(pinf, +0.0) ) );
>   VERIFY( eq( std::proj(-c0p) , std::complex<long double>(pinf, -0.0) ) );
> @@ -392,6 +397,7 @@ test03()
>   const std::complex<long double> cnp(ninf, pinf);
>   VERIFY( eq( std::proj(cnp)  , std::complex<long double>(pinf, +0.0) ) );
>   VERIFY( eq( std::proj(-cnp) , std::complex<long double>(pinf, -0.0) ) );
> +#endif
> }
> 
> int
> 
> 
> 

Reply via email to