diff options
Diffstat (limited to 'llvm/unittests/IR/IRBuilderTest.cpp')
-rw-r--r-- | llvm/unittests/IR/IRBuilderTest.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/unittests/IR/IRBuilderTest.cpp b/llvm/unittests/IR/IRBuilderTest.cpp index d7712fda127..814da64c785 100644 --- a/llvm/unittests/IR/IRBuilderTest.cpp +++ b/llvm/unittests/IR/IRBuilderTest.cpp @@ -183,6 +183,8 @@ TEST_F(IRBuilderTest, ConstrainedFP) { // See if we get constrained intrinsics instead of non-constrained // instructions. Builder.setIsFPConstrained(true); + auto Parent = BB->getParent(); + Parent->addFnAttr(Attribute::StrictFP); V = Builder.CreateFAdd(V, V); ASSERT_TRUE(isa<IntrinsicInst>(V)); @@ -233,7 +235,8 @@ TEST_F(IRBuilderTest, ConstrainedFP) { AttributeSet CallAttrs = II->getAttributes().getFnAttributes(); EXPECT_EQ(CallAttrs.hasAttribute(Attribute::StrictFP), true); - // Verify attributes on the containing function are created automatically. + // Verify attributes on the containing function are created when requested. + Builder.setConstrainedFPFunctionAttr(); AttributeList Attrs = BB->getParent()->getAttributes(); AttributeSet FnAttrs = Attrs.getFnAttributes(); EXPECT_EQ(FnAttrs.hasAttribute(Attribute::StrictFP), true); |