1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00

Check an additional property specific to the way LLVM

iterates over SCC's.

llvm-svn: 136353
This commit is contained in:
Duncan Sands 2011-07-28 14:33:01 +00:00
parent f9a0cc2e7b
commit bda9b8bd4b

View File

@ -322,6 +322,21 @@ TEST(SCCIteratorTest, AllSmallGraphs) {
EXPECT_TRUE(NodesInSomeSCC.Meet(NodesInThisSCC).isEmpty());
NodesInSomeSCC = NodesInSomeSCC.Join(NodesInThisSCC);
// Check a property that is specific to the LLVM SCC iterator and
// guaranteed by it: if a node in SCC S1 has an edge to a node in
// SCC S2, then S1 is visited *after* S2. This means that the set
// of nodes reachable from this SCC must be contained either in the
// union of this SCC and all previously visited SCC's.
for (unsigned i = 0; i != NUM_NODES; ++i)
if (NodesInThisSCC.count(i)) {
GT::NodeSubset NodesReachableFromSCC = G.NodesReachableFrom(i);
EXPECT_TRUE(NodesReachableFromSCC.isSubsetOf(NodesInSomeSCC));
// The result must be the same for all other nodes in this SCC, so
// there is no point in checking them.
break;
}
}
// Finally, check that the nodes in some SCC are exactly those that are