Commit 88d562a8b5912e99306063fe3bc289bab6ca6ebe

Josh Triplett 2014-03-15T22:08:19

testsuite/libffi.call/many_win32.c: Avoid spurious failure due to excess precision The test case testsuite/libffi.call/many_win32.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.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/testsuite/libffi.call/many_win32.c b/testsuite/libffi.call/many_win32.c
index 1b26332..d9038f4 100644
--- a/testsuite/libffi.call/many_win32.c
+++ b/testsuite/libffi.call/many_win32.c
@@ -23,7 +23,7 @@ static float __attribute__((stdcall)) stdcall_many(float f1,
 						   float f12,
 						   float f13)
 {
-  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)