[llvm] [libc][bazel] Add missing MPFR test targets for fmax/fmin family (PR #223867)
Usef Ahmed via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 5 11:57:22 PDT 2026
https://github.com/usefahmed07 updated https://github.com/llvm/llvm-project/pull/223867
>From eeca50f87d6ea2f4ebd14337ec89331b9728379b Mon Sep 17 00:00:00 2001
From: usefahmed07 <youssef.ahmed.hamaza at gmail.com>
Date: Wed, 16 Sep 2026 01:59:06 +0300
Subject: [PATCH 1/4] [libc][bazel] Add missing MPFR test target for
fmaxl/fminl
Add math_mpfr_test targets for fmaxl and fminl which had MPFR-based
tests in libc/test/src/math/ but were missing from the Bazel BUILD
file.
Part of #223717
---
.../llvm-project-overlay/libc/test/src/math/BUILD.bazel | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/utils/bazel/llvm-project-overlay/libc/test/src/math/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/test/src/math/BUILD.bazel
index bb65e582cacd0..f1b1cee7da1f4 100644
--- a/utils/bazel/llvm-project-overlay/libc/test/src/math/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/test/src/math/BUILD.bazel
@@ -384,7 +384,7 @@ math_mpfr_test(
)
math_mpfr_test(
- name = "frexp",
+ name = "8frexp",
hdrs = ["FrexpTest.h"],
)
@@ -392,12 +392,12 @@ math_mpfr_test(
name = "frexpf",
hdrs = ["FrexpTest.h"],
)
-
+math_mpfr_test(name = "fmaxl")
+math_mpfr_test(name = "fminl")
math_mpfr_test(
name = "frexpf16",
hdrs = ["FrexpTest.h"],
)
-
math_mpfr_test(
name = "frexpbf16",
hdrs = ["FrexpTest.h"],
>From 7a64c20d5759236d430ce884ad0aed8b614ee3a7 Mon Sep 17 00:00:00 2001
From: usefahmed07 <youssef.ahmed.hamaza at gmail.com>
Date: Thu, 17 Sep 2026 00:31:47 +0300
Subject: [PATCH 2/4] [libc][bazel] Add missing math_mpfr_test targets for fma,
fmaf, ffma, ffmal, dfmal, fmul, fmull, dmull
Also fixes a pre-existing typo (8frexp -> frexp).
fmal is intentionally omitted; it is not yet implemented in libc/src/math.
---
.../libc/test/src/math/BUILD.bazel | 79 ++++++++++++++++++-
1 file changed, 76 insertions(+), 3 deletions(-)
diff --git a/utils/bazel/llvm-project-overlay/libc/test/src/math/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/test/src/math/BUILD.bazel
index f1b1cee7da1f4..f31f0f50e0bd8 100644
--- a/utils/bazel/llvm-project-overlay/libc/test/src/math/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/test/src/math/BUILD.bazel
@@ -283,7 +283,23 @@ math_mpfr_test(
hdrs = ["DivTest.h"],
)
-# TODO: Add ffma, ffmal test. Missing stdlib/rand dependency.
+math_mpfr_test(
+ name = "ffma",
+ hdrs = ["FmaTest.h"],
+ deps = [
+ "//libc:rand",
+ "//libc:srand",
+ ],
+)
+
+math_mpfr_test(
+ name = "ffmal",
+ hdrs = ["FmaTest.h"],
+ deps = [
+ "//libc:rand",
+ "//libc:srand",
+ ],
+)
math_mpfr_test(
name = "floor",
@@ -311,7 +327,60 @@ math_mpfr_test(
deps = ["//libc:__support_fputil_bfloat16"],
)
-# TODO: Add fma, fmaf, fmal, fmul, fmull tests. Missing stdlib/rand dependency.
+# NOTE: fmal is not yet implemented in libc/src/math; omitted until it lands.
+math_mpfr_test(
+ name = "fma",
+ hdrs = ["FmaTest.h"],
+ deps = [
+ "//libc:rand",
+ "//libc:srand",
+ ],
+)
+
+math_mpfr_test(
+ name = "fmaf",
+ hdrs = ["FmaTest.h"],
+ deps = [
+ "//libc:rand",
+ "//libc:srand",
+ ],
+)
+
+math_mpfr_test(
+ name = "dfmal",
+ hdrs = ["FmaTest.h"],
+ deps = [
+ "//libc:rand",
+ "//libc:srand",
+ ],
+)
+
+math_mpfr_test(
+ name = "fmul",
+ hdrs = ["MulTest.h"],
+ deps = [
+ "//libc:rand",
+ "//libc:srand",
+ ],
+)
+
+math_mpfr_test(
+ name = "fmull",
+ hdrs = ["MulTest.h"],
+ deps = [
+ "//libc:rand",
+ "//libc:srand",
+ ],
+)
+
+math_mpfr_test(
+ name = "dmull",
+ hdrs = ["MulTest.h"],
+ deps = [
+ "//libc:rand",
+ "//libc:srand",
+ ],
+)
math_mpfr_test(
name = "f16mul",
@@ -384,7 +453,7 @@ math_mpfr_test(
)
math_mpfr_test(
- name = "8frexp",
+ name = "frexp",
hdrs = ["FrexpTest.h"],
)
@@ -392,12 +461,16 @@ math_mpfr_test(
name = "frexpf",
hdrs = ["FrexpTest.h"],
)
+
math_mpfr_test(name = "fmaxl")
+
math_mpfr_test(name = "fminl")
+
math_mpfr_test(
name = "frexpf16",
hdrs = ["FrexpTest.h"],
)
+
math_mpfr_test(
name = "frexpbf16",
hdrs = ["FrexpTest.h"],
>From 6447157499916af028b977c643d243d7cfc969e4 Mon Sep 17 00:00:00 2001
From: usefahmed07 <youssef.ahmed.hamaza at gmail.com>
Date: Fri, 25 Sep 2026 18:23:47 +0300
Subject: [PATCH 3/4] Apply review suggestion: clarify fmal TODO comment
---
utils/bazel/llvm-project-overlay/libc/test/src/math/BUILD.bazel | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/utils/bazel/llvm-project-overlay/libc/test/src/math/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/test/src/math/BUILD.bazel
index f31f0f50e0bd8..1007160b307d9 100644
--- a/utils/bazel/llvm-project-overlay/libc/test/src/math/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/test/src/math/BUILD.bazel
@@ -327,7 +327,7 @@ math_mpfr_test(
deps = ["//libc:__support_fputil_bfloat16"],
)
-# NOTE: fmal is not yet implemented in libc/src/math; omitted until it lands.
+# TODO: Add fmal tests. Missing stdlib/rand dependency.
math_mpfr_test(
name = "fma",
hdrs = ["FmaTest.h"],
>From e124348aaaaab352850f21a2c79da5c49903fc0b Mon Sep 17 00:00:00 2001
From: usefahmed07 <youssef.ahmed.hamaza at gmail.com>
Date: Fri, 25 Sep 2026 18:37:53 +0300
Subject: [PATCH 4/4] Address review nits: add hdrs to fmaxl/fminl, revert
dfmal/dmull to TODO comments
---
.../libc/test/src/math/BUILD.bazel | 28 +++++++------------
1 file changed, 10 insertions(+), 18 deletions(-)
diff --git a/utils/bazel/llvm-project-overlay/libc/test/src/math/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/test/src/math/BUILD.bazel
index 1007160b307d9..2f0db1da52cc3 100644
--- a/utils/bazel/llvm-project-overlay/libc/test/src/math/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/test/src/math/BUILD.bazel
@@ -346,14 +346,7 @@ math_mpfr_test(
],
)
-math_mpfr_test(
- name = "dfmal",
- hdrs = ["FmaTest.h"],
- deps = [
- "//libc:rand",
- "//libc:srand",
- ],
-)
+# TODO: Add dfmal tests. Missing stdlib/rand dependency.
math_mpfr_test(
name = "fmul",
@@ -373,14 +366,7 @@ math_mpfr_test(
],
)
-math_mpfr_test(
- name = "dmull",
- hdrs = ["MulTest.h"],
- deps = [
- "//libc:rand",
- "//libc:srand",
- ],
-)
+# TODO: Add dmull tests. Missing stdlib/rand dependency.
math_mpfr_test(
name = "f16mul",
@@ -462,9 +448,15 @@ math_mpfr_test(
hdrs = ["FrexpTest.h"],
)
-math_mpfr_test(name = "fmaxl")
+math_mpfr_test(
+ name = "fmaxl",
+ hdrs = ["FMaxTest.h"],
+)
-math_mpfr_test(name = "fminl")
+math_mpfr_test(
+ name = "fminl",
+ hdrs = ["FMinTest.h"],
+)
math_mpfr_test(
name = "frexpf16",
More information about the llvm-commits
mailing list