about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTrevor Gross <tmgross@umich.edu>2025-05-02 00:46:21 +0000
committerTrevor Gross <t.gross35@gmail.com>2025-05-01 21:24:34 -0400
commit1c5f8cc72df4b82f2265737c9e86a4e4365cae8c (patch)
tree116ed4f2538813fc11b5a1ff8ec102ad7ea215ea
parent4c2659f9cee7829bea317d5c6f575a7f4fb13628 (diff)
downloadrust-1c5f8cc72df4b82f2265737c9e86a4e4365cae8c.tar.gz
rust-1c5f8cc72df4b82f2265737c9e86a4e4365cae8c.zip
fmaf: Add a test case from a MinGW failure
This is a known problem in the MinGW fmaf implementation, identified at
[1].  Make sure our implementation passes this edge case.

[1]: https://github.com/rust-lang/rust/issues/140515
-rw-r--r--library/compiler-builtins/libm-test/src/generate/case_list.rs13
1 files changed, 12 insertions, 1 deletions
diff --git a/library/compiler-builtins/libm-test/src/generate/case_list.rs b/library/compiler-builtins/libm-test/src/generate/case_list.rs
index f1e6fcec397..43b28722f2d 100644
--- a/library/compiler-builtins/libm-test/src/generate/case_list.rs
+++ b/library/compiler-builtins/libm-test/src/generate/case_list.rs
@@ -269,7 +269,18 @@ fn fma_cases() -> Vec<TestCase<op::fma::Routine>> {
 }
 
 fn fmaf_cases() -> Vec<TestCase<op::fmaf::Routine>> {
-    vec![]
+    let mut v = vec![];
+    TestCase::append_pairs(
+        &mut v,
+        &[
+            // Known rounding error for some implementations (notably MinGW)
+            (
+                (-1.9369631e13f32, 2.1513551e-7, -1.7354427e-24),
+                Some(-4167095.8),
+            ),
+        ],
+    );
+    v
 }
 
 #[cfg(f128_enabled)]