fma tests: Avoid shadowing local variables.
authorBruno Haible <bruno@clisp.org>
Sun, 20 Nov 2011 16:43:49 +0000 (17:43 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 20 Nov 2011 16:43:49 +0000 (17:43 +0100)
* tests/test-fma2.h (test_function): Reduce scope of x, y, z, result,
expected.

ChangeLog
tests/test-fma2.h

index 21a9c6d..e447786 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2011-11-20  Bruno Haible  <bruno@clisp.org>
 
+       fma tests: Avoid shadowing local variables.
+       * tests/test-fma2.h (test_function): Reduce scope of x, y, z, result,
+       expected.
+
+2011-11-20  Bruno Haible  <bruno@clisp.org>
+
        copysignf tests: Fix.
        * tests/test-copysignf.c: Fix signature check.
 
index 1bbb5de..349cf98 100644 (file)
@@ -52,14 +52,14 @@ test_function (DOUBLE (*my_fma) (DOUBLE, DOUBLE, DOUBLE))
       L_(1.0), - L_(1.0), L_(1.0), - L_(1.0),
       L_(1.0), - L_(1.0), L_(1.0), - L_(1.0)
     };
-  volatile DOUBLE x;
-  volatile DOUBLE y;
-  volatile DOUBLE z;
-  volatile DOUBLE result;
-  volatile DOUBLE expected;
 
   /* A product x * y that consists of two bits.  */
   {
+    volatile DOUBLE x;
+    volatile DOUBLE y;
+    volatile DOUBLE z;
+    volatile DOUBLE result;
+    volatile DOUBLE expected;
     int xs;
     int xe;
     int ys;
@@ -127,6 +127,11 @@ test_function (DOUBLE (*my_fma) (DOUBLE, DOUBLE, DOUBLE))
   }
   /* A product x * y that consists of three bits.  */
   {
+    volatile DOUBLE x;
+    volatile DOUBLE y;
+    volatile DOUBLE z;
+    volatile DOUBLE result;
+    volatile DOUBLE expected;
     int i;
     int xs;
     int xe;
@@ -361,6 +366,11 @@ test_function (DOUBLE (*my_fma) (DOUBLE, DOUBLE, DOUBLE))
   /* A product x * y that consists of one segment of bits (or, if you prefer,
      two bits, one with positive weight and one with negative weight).  */
   {
+    volatile DOUBLE x;
+    volatile DOUBLE y;
+    volatile DOUBLE z;
+    volatile DOUBLE result;
+    volatile DOUBLE expected;
     int i;
     int xs;
     int xe;