From 744cc71360867080b00ec79242fbec52c746e8d5 Mon Sep 17 00:00:00 2001 From: Krishna Pandey Date: Wed, 30 Jul 2025 00:37:53 +0530 Subject: [PATCH 1/2] chore: make bfloat16 comp-ops test constexpr Signed-off-by: Krishna Pandey --- .../FPUtil/comparison_operations_test.cpp | 26 +++++-------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/libc/test/src/__support/FPUtil/comparison_operations_test.cpp b/libc/test/src/__support/FPUtil/comparison_operations_test.cpp index 04a3321fd5dbf..5bb00f2016c67 100644 --- a/libc/test/src/__support/FPUtil/comparison_operations_test.cpp +++ b/libc/test/src/__support/FPUtil/comparison_operations_test.cpp @@ -25,27 +25,15 @@ template class ComparisonOperationsTest : public LIBC_NAMESPACE::testing::FEnvSafeTest { DECLARE_SPECIAL_CONSTANTS(T) - // TODO: Make these constexpr once quick_get_round is made constexpr. - T normal1; - T neg_normal1; - T normal2; - T small; - T neg_small; - T large; - T neg_large; + static constexpr T normal1 = T(3.14); + static constexpr T neg_normal1 = T(-3.14); + static constexpr T normal2 = T(2.71); + static constexpr T small = T(0.1); + static constexpr T neg_small = T(-0.1); + static constexpr T large = T(10000.0); + static constexpr T neg_large = T(-10000.0); public: - void SetUp() override { - with_fenv_preserved([this]() { - normal1 = T(3.14); - neg_normal1 = T(-3.14); - normal2 = T(2.71); - small = T(0.1); - neg_small = T(-0.1); - large = T(10000.0); - neg_large = T(-10000.0); - }); - } void test_equals() { EXPECT_TRUE(equals(neg_zero, neg_zero)); From 861088ce34b8d2345c68e40dd87dc4e1722af9ff Mon Sep 17 00:00:00 2001 From: Krishna Pandey Date: Wed, 30 Jul 2025 01:06:50 +0530 Subject: [PATCH 2/2] style: clang-format Signed-off-by: Krishna Pandey --- libc/test/src/__support/FPUtil/comparison_operations_test.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/libc/test/src/__support/FPUtil/comparison_operations_test.cpp b/libc/test/src/__support/FPUtil/comparison_operations_test.cpp index 5bb00f2016c67..05b8f68441532 100644 --- a/libc/test/src/__support/FPUtil/comparison_operations_test.cpp +++ b/libc/test/src/__support/FPUtil/comparison_operations_test.cpp @@ -34,7 +34,6 @@ class ComparisonOperationsTest : public LIBC_NAMESPACE::testing::FEnvSafeTest { static constexpr T neg_large = T(-10000.0); public: - void test_equals() { EXPECT_TRUE(equals(neg_zero, neg_zero)); EXPECT_TRUE(equals(zero, neg_zero));