[Utils] LocalTest: fix SimplifyCFGWithNullAC test to work with `-simplifycfg-require...
authorRoman Lebedev <lebedev.ri@gmail.com>
Fri, 1 Jan 2021 21:20:50 +0000 (00:20 +0300)
committerRoman Lebedev <lebedev.ri@gmail.com>
Fri, 1 Jan 2021 22:01:18 +0000 (01:01 +0300)
llvm/unittests/Transforms/Utils/LocalTest.cpp

index ece8395..a57a18c 100644 (file)
@@ -998,8 +998,12 @@ TEST(Local, SimplifyCFGWithNullAC) {
   }
   ASSERT_TRUE(TestBB);
 
+  DominatorTree DT(F);
+  DomTreeUpdater DTU(DT, DomTreeUpdater::UpdateStrategy::Eager);
+
   // %test.bb is expected to be simplified by FoldCondBranchOnPHI.
-  EXPECT_TRUE(simplifyCFG(TestBB, TTI, /*DTU=*/nullptr, Options));
+  EXPECT_TRUE(simplifyCFG(TestBB, TTI,
+                          RequireAndPreserveDomTree ? &DTU : nullptr, Options));
 }
 
 TEST(Local, CanReplaceOperandWithVariable) {