[llvm] d1c21d0 - Add some unit tests for DenormalMode helper

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 22 03:18:07 PDT 2023


Author: Matt Arsenault
Date: 2023-06-22T06:18:02-04:00
New Revision: d1c21d08ab45b9a590ddaa954682026222616b30

URL: https://github.com/llvm/llvm-project/commit/d1c21d08ab45b9a590ddaa954682026222616b30
DIFF: https://github.com/llvm/llvm-project/commit/d1c21d08ab45b9a590ddaa954682026222616b30.diff

LOG: Add some unit tests for DenormalMode helper

Split out from D143180

Added: 
    

Modified: 
    llvm/unittests/ADT/FloatingPointMode.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/unittests/ADT/FloatingPointMode.cpp b/llvm/unittests/ADT/FloatingPointMode.cpp
index 5eff9de92ee84..b87507625542e 100644
--- a/llvm/unittests/ADT/FloatingPointMode.cpp
+++ b/llvm/unittests/ADT/FloatingPointMode.cpp
@@ -219,4 +219,11 @@ TEST(FloatingPointModeTest, DenormalModeMerge) {
       DenormalMode::getIEEE(),
       DenormalMode::getPreserveSign().mergeCalleeMode(DenormalMode::getIEEE()));
 }
+
+TEST(FloatingPointModeTest, DenormalModePredicates) {
+  EXPECT_TRUE(DenormalMode::getPreserveSign().inputsAreZero());
+  EXPECT_TRUE(DenormalMode::getPositiveZero().inputsAreZero());
+  EXPECT_FALSE(DenormalMode::getIEEE().inputsAreZero());
+  EXPECT_FALSE(DenormalMode::getDynamic().inputsAreZero());
+}
 }


        


More information about the llvm-commits mailing list