[libc] [llvm] [libc][math] Update test/src/math/smoke/FmaTest.h to not rely on compiler runtime. (PR #159503)

via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 17 21:23:48 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: None (lntue)

<details>
<summary>Changes</summary>



---
Full diff: https://github.com/llvm/llvm-project/pull/159503.diff


2 Files Affected:

- (modified) libc/test/src/math/smoke/FmaTest.h (+1-1) 
- (modified) utils/bazel/llvm-project-overlay/libc/test/src/math/smoke/BUILD.bazel (+18-20) 


``````````diff
diff --git a/libc/test/src/math/smoke/FmaTest.h b/libc/test/src/math/smoke/FmaTest.h
index 5d344d9e7ebe7..c2d47a979e335 100644
--- a/libc/test/src/math/smoke/FmaTest.h
+++ b/libc/test/src/math/smoke/FmaTest.h
@@ -88,7 +88,7 @@ class FmaTestTemplate : public LIBC_NAMESPACE::testing::FEnvSafeTest {
     // Test overflow.
     OutType z = out.max_normal;
     InType in_z = LIBC_NAMESPACE::fputil::cast<InType>(out.max_normal);
-    EXPECT_FP_EQ_ALL_ROUNDING(OutType(0.75) * z,
+    EXPECT_FP_EQ_ALL_ROUNDING(func(InType(-0.25), in_z, in_z),
                               func(InType(1.75), in_z, -in_z));
 
     // Exact cancellation.
diff --git a/utils/bazel/llvm-project-overlay/libc/test/src/math/smoke/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/test/src/math/smoke/BUILD.bazel
index 2bffcdea58478..7f3722c0df661 100644
--- a/utils/bazel/llvm-project-overlay/libc/test/src/math/smoke/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/test/src/math/smoke/BUILD.bazel
@@ -204,21 +204,20 @@ math_test(
     hdrs = ["FmaTest.h"],
 )
 
-# TODO: Reenable these tests once they pass at Google.
-# math_test(
-#     name = "f16fma",
-#     hdrs = ["FmaTest.h"],
-# )
-#
-# math_test(
-#     name = "f16fmaf",
-#     hdrs = ["FmaTest.h"],
-# )
-#
-# math_test(
-#     name = "f16fmal",
-#     hdrs = ["FmaTest.h"],
-# )
+math_test(
+    name = "f16fma",
+    hdrs = ["FmaTest.h"],
+)
+
+math_test(
+    name = "f16fmaf",
+    hdrs = ["FmaTest.h"],
+)
+
+math_test(
+    name = "f16fmal",
+    hdrs = ["FmaTest.h"],
+)
 
 math_test(
     name = "dmull",
@@ -477,11 +476,10 @@ math_test(
 
 # TODO: Add fma, fmaf, fmal, fmaf128 tests.
 
-# TODO: Reenable this test once it passes at Google.
-# math_test(
-#     name = "fmaf16",
-#     hdrs = ["FmaTest.h"],
-# )
+math_test(
+    name = "fmaf16",
+    hdrs = ["FmaTest.h"],
+)
 
 math_test(
     name = "fmax",

``````````

</details>


https://github.com/llvm/llvm-project/pull/159503


More information about the llvm-commits mailing list