Skip to content

Commit 5f76369

Browse files
authored
[libc][math] Update test/src/math/smoke/FmaTest.h to not rely on compiler runtime. (llvm#159503)
1 parent 5e1b416 commit 5f76369

File tree

2 files changed

+19
-22
lines changed
  • libc/test/src/math/smoke
  • utils/bazel/llvm-project-overlay/libc/test/src/math/smoke

2 files changed

+19
-22
lines changed

libc/test/src/math/smoke/FmaTest.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,8 @@ class FmaTestTemplate : public LIBC_NAMESPACE::testing::FEnvSafeTest {
8686
}
8787

8888
// Test overflow.
89-
OutType z = out.max_normal;
9089
InType in_z = LIBC_NAMESPACE::fputil::cast<InType>(out.max_normal);
91-
EXPECT_FP_EQ_ALL_ROUNDING(OutType(0.75) * z,
90+
EXPECT_FP_EQ_ALL_ROUNDING(func(InType(-0.25), in_z, in_z),
9291
func(InType(1.75), in_z, -in_z));
9392

9493
// Exact cancellation.

utils/bazel/llvm-project-overlay/libc/test/src/math/smoke/BUILD.bazel

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -204,21 +204,20 @@ math_test(
204204
hdrs = ["FmaTest.h"],
205205
)
206206

207-
# TODO: Reenable these tests once they pass at Google.
208-
# math_test(
209-
# name = "f16fma",
210-
# hdrs = ["FmaTest.h"],
211-
# )
212-
#
213-
# math_test(
214-
# name = "f16fmaf",
215-
# hdrs = ["FmaTest.h"],
216-
# )
217-
#
218-
# math_test(
219-
# name = "f16fmal",
220-
# hdrs = ["FmaTest.h"],
221-
# )
207+
math_test(
208+
name = "f16fma",
209+
hdrs = ["FmaTest.h"],
210+
)
211+
212+
math_test(
213+
name = "f16fmaf",
214+
hdrs = ["FmaTest.h"],
215+
)
216+
217+
math_test(
218+
name = "f16fmal",
219+
hdrs = ["FmaTest.h"],
220+
)
222221

223222
math_test(
224223
name = "dmull",
@@ -485,11 +484,10 @@ math_test(
485484
hdrs = ["FmaTest.h"],
486485
)
487486

488-
# TODO: Reenable this test once it passes at Google.
489-
# math_test(
490-
# name = "fmaf16",
491-
# hdrs = ["FmaTest.h"],
492-
# )
487+
math_test(
488+
name = "fmaf16",
489+
hdrs = ["FmaTest.h"],
490+
)
493491

494492
math_test(
495493
name = "fmax",

0 commit comments

Comments
 (0)