Make test more robust
authorAdam Nemet <anemet@apple.com>
Tue, 21 Mar 2017 23:50:52 +0000 (23:50 +0000)
committerAdam Nemet <anemet@apple.com>
Tue, 21 Mar 2017 23:50:52 +0000 (23:50 +0000)
Set the flags on FAdd locally rather than assuming nothing will change it from
way earlier in the test.

llvm-svn: 298462

llvm/unittests/IR/IRBuilderTest.cpp

index 1812cd3..5b27fd6 100644 (file)
@@ -245,6 +245,7 @@ TEST_F(IRBuilderTest, FastMathFlags) {
   EXPECT_FALSE(FDiv->getFastMathFlags().any());
   FDiv->setHasAllowReciprocal(true);
   FAdd->setHasAllowReciprocal(false);
+  FAdd->setHasNoNaNs(true);
   FDiv->copyFastMathFlags(FAdd);
   EXPECT_TRUE(FDiv->hasNoNaNs());
   EXPECT_FALSE(FDiv->hasAllowReciprocal());