This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


On 03/21/2013 03:40 PM, Thomas Schwinge wrote:
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.

Let's move forward with your current patch,

Andreas
--
 Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi
  SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 NÃrnberg, Germany
   GF: Jeff Hawn,Jennifer Guild,Felix ImendÃrffer,HRB16746 (AG NÃrnberg)
    GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]