summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/IR
diff options
context:
space:
mode:
authorMelanie Blower <melanie.blower@intel.com>2019-12-02 11:22:52 -0800
committerMelanie Blower <melanie.blower@intel.com>2019-12-04 11:32:33 -0800
commitcdbed2dd856c14687efd741c2d8321686102acb8 (patch)
treea51de1b31c871c79e7d2486466463562cdaa9a7d /llvm/unittests/IR
parent75bbbeec74bbac327768a636d025f292a955c672 (diff)
downloadbcm5719-llvm-cdbed2dd856c14687efd741c2d8321686102acb8.tar.gz
bcm5719-llvm-cdbed2dd856c14687efd741c2d8321686102acb8.zip
Reapply af57dbf12e54 "Add support for options -frounding-math, ftrapping-math, -ffp-model=, and -ffp-exception-behavior="
Patch was reverted because https://bugs.llvm.org/show_bug.cgi?id=44048 The original patch is modified to set the strictfp IR attribute explicitly in CodeGen instead of as a side effect of IRBuilder Differential Revision: https://reviews.llvm.org/D62731
Diffstat (limited to 'llvm/unittests/IR')
-rw-r--r--llvm/unittests/IR/IRBuilderTest.cpp5
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);
OpenPOWER on IntegriCloud