[PhiValues] Adjust unit test to invalidate instructions before deleting them
authorJohn Brawn <john.brawn@arm.com>
Thu, 28 Jun 2018 15:17:07 +0000 (15:17 +0000)
committerJohn Brawn <john.brawn@arm.com>
Thu, 28 Jun 2018 15:17:07 +0000 (15:17 +0000)
This should fix a sanitizer buildbot failure.

llvm-svn: 335862

llvm/unittests/Analysis/PhiValuesTest.cpp

index 9a1b5d7..303b0df 100644 (file)
@@ -194,8 +194,8 @@ TEST(PhiValuesTest, DependentPhi) {
 
   // Check that replacing an incoming phi then deleting it works
   Phi3->setIncomingValue(1, Val2);
-  Phi2->eraseFromParent();
   PV.invalidateValue(Phi2);
+  Phi2->eraseFromParent();
   PV.invalidateValue(Phi3);
   Vals = PV.getValuesForPhi(Phi1);
   EXPECT_EQ(Vals.size(), 2u);