diff options
Diffstat (limited to 'unittests/IR/IRBuilderTest.cpp')
-rw-r--r-- | unittests/IR/IRBuilderTest.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/unittests/IR/IRBuilderTest.cpp b/unittests/IR/IRBuilderTest.cpp index e0da018..82565cc 100644 --- a/unittests/IR/IRBuilderTest.cpp +++ b/unittests/IR/IRBuilderTest.cpp @@ -217,6 +217,11 @@ TEST_F(IRBuilderTest, FastMathFlags) { FCall = Builder.CreateCall(Callee, None); EXPECT_FALSE(FCall->hasNoNaNs()); + Value *V = + Function::Create(CalleeTy, Function::ExternalLinkage, "", M.get()); + FCall = Builder.CreateCall(V, None); + EXPECT_FALSE(FCall->hasNoNaNs()); + FMF.clear(); FMF.setNoNaNs(); Builder.SetFastMathFlags(FMF); @@ -226,6 +231,11 @@ TEST_F(IRBuilderTest, FastMathFlags) { EXPECT_TRUE(Builder.getFastMathFlags().NoNaNs); EXPECT_TRUE(FCall->hasNoNaNs()); + FCall = Builder.CreateCall(V, None); + EXPECT_TRUE(Builder.getFastMathFlags().any()); + EXPECT_TRUE(Builder.getFastMathFlags().NoNaNs); + EXPECT_TRUE(FCall->hasNoNaNs()); + Builder.clearFastMathFlags(); // To test a copy, make sure that a '0' and a '1' change state. |