On 12/12/16 13:55 +0000, Kyrill Tkachov wrote:
Hi all,

I've been investigating the execution failures of:
21_strings/basic_string/numeric_conversions/char/stod.cc
21_strings/basic_string/numeric_conversions/wchar_t/stod.cc
21_strings/basic_string/numeric_conversions/wchar_t/stold.cc
27_io/basic_ostream/inserters_arithmetic/char/hexfloat.cc

on aarch64-none-elf, a newlib target.
The reason they are failing is because they are converting a long double to a 
string using to_string
before trying to convert it back into a number.
to_string ends up calling a vsnprintf from the C library (newlib in this case) 
with the %Lf format
to convert from long double.
Unfortunately the %Lf format is broken in newlib for platforms where long 
double is not the same as double.
It gives bogus results because newlib doesn't implement the long double variant 
of frexp (frexpl) which is needed
to implement printf properly. So it ends up using frexp even on long doubles. 
This gives wrong results which causes
these tests to fail.

So this patch marks them as XFAIL and adds an effective target check for broken 
newlib versions.

With this patch these tests appear as XFAIL on aarch64-none-elf.

Ok for trunk?

Yes OK, thanks.

Reply via email to