testsuite/libffi.call/many.c: Avoid spurious failure due to excess precision
authorJosh Triplett <josh@joshtriplett.org>
Sun, 16 Mar 2014 05:08:19 +0000 (22:08 -0700)
committerJosh Triplett <josh@joshtriplett.org>
Sun, 16 Mar 2014 11:39:37 +0000 (04:39 -0700)
The test case testsuite/libffi.call/many.c can spuriously fail due to
excess floating-point precision.  Instrumenting it with some printf
calls shows differences well above FLT_EPSILON.  (Note when
instrumenting it that multiple computations of the difference, such as
one in a print and another in the conditional, may produce different
results.)

Rather than complicating the test suite with architecture-specific flags
to avoid excess precision, just simplify the floating-point computation
to avoid a dependency on potential excess precision.

testsuite/libffi.call/many.c

index 11818e6..5447664 100644 (file)
@@ -32,7 +32,7 @@ static float many(float f1,
         (double) f11, (double) f12, (double) f13);
 #endif
 
-  return f1/f2+f3/f4+f5/f6+f7/f8+f9/f10+f11/f12+f13;
+  return f1+f2+f3+f4+f5+f6+f7+f8+f9+f10+f11+f12+f13;
 }
 
 int main (void)