[PATCH] Fix up long double fphex
Jakub Jelinek
jakub@redhat.com
Tue Mar 6 21:27:00 GMT 2012
On Sun, Mar 04, 2012 at 09:42:57PM +0100, Marek Polacek wrote:
> --- libc/stdio-common/tst-long-dbl-fphex.c.mp 2012-03-04 19:09:18.595925212 +0100
> +++ libc/stdio-common/tst-long-dbl-fphex.c 2012-03-04 19:08:07.479774042 +0100
...
> +static int
> +do_test (void)
> +{
> + const long double x = 24.5;
> + wchar_t a[16 * sizeof (wchar_t)];
> + swprintf (a, 16 * sizeof (wchar_t), L"%La\n", x);
> + wchar_t A[16 * sizeof (wchar_t)];
> + swprintf (A, 16 * sizeof (wchar_t), L"%LA\n", x);
> +
> + return (wmemcmp (a, L"0xc.4p+1", 8) != 0
> + || wmemcmp (A, L"0XC.4P+1", 8) != 0);
I'm pretty sure this test fails on targets where long double isn't ldbl-96, but
ldbl-128, ldbl-128ibm or dbl-64, because for those
a will be L"0x1.88p+4" and A L"0X1.88P+4". Only ldbl-96 %La/%LA printing ever
prints before hexadecimal dot numbers from 2 to f/F.
Jakub
More information about the Libc-alpha
mailing list