aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Analysis/LazyCallGraphTest.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2014-04-28 10:49:06 +0000
committerChandler Carruth <chandlerc@gmail.com>2014-04-28 10:49:06 +0000
commit3f5f5fe16434381e1fc375396278d4e379a291b0 (patch)
treec3c1d66fa939060140a5409e29cd93224aed2342 /llvm/unittests/Analysis/LazyCallGraphTest.cpp
parent5bdf72cef61095452852731e6a3259709109e009 (diff)
downloadllvm-3f5f5fe16434381e1fc375396278d4e379a291b0.zip
llvm-3f5f5fe16434381e1fc375396278d4e379a291b0.tar.gz
llvm-3f5f5fe16434381e1fc375396278d4e379a291b0.tar.bz2
[LCG] Make the return of the IntraSCC removal method actually match its
contract (and be much more useful). It now provides exactly the post-order traversal a caller might need to perform on newly formed SCCs. llvm-svn: 207410
Diffstat (limited to 'llvm/unittests/Analysis/LazyCallGraphTest.cpp')
-rw-r--r--llvm/unittests/Analysis/LazyCallGraphTest.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/unittests/Analysis/LazyCallGraphTest.cpp b/llvm/unittests/Analysis/LazyCallGraphTest.cpp
index dd66c5c..3fbd3ec 100644
--- a/llvm/unittests/Analysis/LazyCallGraphTest.cpp
+++ b/llvm/unittests/Analysis/LazyCallGraphTest.cpp
@@ -378,18 +378,21 @@ TEST(LazyCallGraphTest, IntraSCCEdgeRemoval) {
// Remove the edge from b -> a, which should leave the 3 functions still in
// a single connected component because of a -> b -> c -> a.
- SCC.removeIntraSCCEdge(B, A);
+ SmallVector<LazyCallGraph::SCC *, 1> NewSCCs = SCC.removeIntraSCCEdge(B, A);
+ EXPECT_EQ(0u, NewSCCs.size());
EXPECT_EQ(&SCC, CG1.lookupSCC(A));
EXPECT_EQ(&SCC, CG1.lookupSCC(B));
EXPECT_EQ(&SCC, CG1.lookupSCC(C));
// Remove the edge from c -> a, which should leave 'a' in the original SCC
// and form a new SCC for 'b' and 'c'.
- SCC.removeIntraSCCEdge(C, A);
+ NewSCCs = SCC.removeIntraSCCEdge(C, A);
+ EXPECT_EQ(1u, NewSCCs.size());
EXPECT_EQ(&SCC, CG1.lookupSCC(A));
EXPECT_EQ(1, std::distance(SCC.begin(), SCC.end()));
LazyCallGraph::SCC *SCC2 = CG1.lookupSCC(B);
EXPECT_EQ(SCC2, CG1.lookupSCC(C));
+ EXPECT_EQ(SCC2, NewSCCs[0]);
}
}