libm-test: Properly wrap blocks consisting of several statements.

Thomas Schwinge thomas@codesourcery.com
Thu Mar 21 14:40:00 GMT 2013


Hi!

On Thu, 21 Mar 2013 15:19:50 +0100, Andreas Jaeger <aj@suse.com> wrote:
> Have a look at the generated file, if it looks fine, then I'm happy. The 
> patch looks fine on first view but I didn't check the output,

Well, it is now fine for some cases: those where the full set of
statements inside a block is emitted by gen-libm-test.pl alone.  Getting
it right for example for the following ones, would need a more thorough
re-architecture of that machinery:

      if (SNAN_TESTS (FLOAT))
        TEST_f_i (fpclassify, snan_value, FP_NAN);

      if (SNAN_TESTS (FLOAT))
        {
          errno = 0;
          TEST_f_i (ilogb, snan_value, FP_ILOGBNAN, INVALID_EXCEPTION);
          check_int ("errno for ilogb(sNaN) unchanged", errno, EDOM, 0, 0, 0);
        }

In the output, these TEST_* (converted to check_*) will not be indented
properly, as gen-libm-test.pl doesn't consider the context (indentation
in source file)/doesn't copy indentation from the source file but instead
always indents by two spaces:

      if (SNAN_TESTS (FLOAT))
      check_int ("fpclassify (sNaN) == FP_NAN", fpclassify (snan_value), FP_NAN, 0, 0, 0);

      if (SNAN_TESTS (FLOAT))
        {
          errno = 0;
      check_int ("ilogb (sNaN) == FP_ILOGBNAN",  FUNC(ilogb) (snan_value), FP_ILOGBNAN, 0, 0, INVALID_EXCEPTION);
          check_int ("errno for ilogb(sNaN) unchanged", errno, EDOM, 0, 0, 0);
        }

Getting this all right however I'd consider a separate issue from the
issue I'm fixing.


Grüße,
 Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 489 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20130321/5e67db43/attachment.sig>


More information about the Libc-alpha mailing list