diff options
Diffstat (limited to 'unittests/VMCore/IRBuilderTest.cpp')
-rw-r--r-- | unittests/VMCore/IRBuilderTest.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/unittests/VMCore/IRBuilderTest.cpp b/unittests/VMCore/IRBuilderTest.cpp index 8a22b104ba..665cfb3f13 100644 --- a/unittests/VMCore/IRBuilderTest.cpp +++ b/unittests/VMCore/IRBuilderTest.cpp @@ -164,6 +164,15 @@ TEST_F(IRBuilderTest, FastMathFlags) { FDiv = cast<Instruction>(F); EXPECT_TRUE(FDiv->hasAllowReciprocal()); + Builder.clearFastMathFlags(); + + F = Builder.CreateFDiv(F, F); + ASSERT_TRUE(isa<Instruction>(F)); + FDiv = cast<Instruction>(F); + EXPECT_FALSE(FDiv->getFastMathFlags().any()); + FDiv->copyFastMathFlags(FAdd); + EXPECT_TRUE(FDiv->hasNoNaNs()); + } } |