Fix floating point compare
authorAnthony Green <green@moxielogic.com>
Sun, 15 Sep 2024 16:32:29 +0000 (12:32 -0400)
committerAnthony Green <green@moxielogic.com>
Sun, 15 Sep 2024 16:32:29 +0000 (12:32 -0400)
testsuite/libffi.call/struct_int_float.c

index 82685814c1df7f54c1c092f103107f0ab4c74215..66ef6c458da2dc4f8c6b480601f905ef351fcb0d 100644 (file)
@@ -14,11 +14,11 @@ typedef struct
 } test_structure_int_float;
 
 static float ABI_ATTR struct_int_float(test_structure_int_float ts1,
-                                       test_structure_int_float ts2,
-                                       test_structure_int_float ts3,
-                                       test_structure_int_float ts4,
-                                       test_structure_int_float ts5,
-                                       test_structure_int_float ts6)
+                                       test_structure_int_float ts2 __UNUSED__,
+                                       test_structure_int_float ts3 __UNUSED__,
+                                       test_structure_int_float ts4 __UNUSED__,
+                                       test_structure_int_float ts5 __UNUSED__,
+                                       test_structure_int_float ts6 __UNUSED__)
 {
   return ts1.f;
 }
@@ -82,7 +82,7 @@ int main (void)
 
   printf ("%g\n", rfloat);
 
-  CHECK(fabs(rfloat - 11.11) < FLT_EPSILON);
+  CHECK(fabs(rfloat - 11.11) < 3 * FLT_EPSILON);
 
   exit(0);
 }