[llvm-commits] [llvm] r136353 - /llvm/trunk/unittests/ADT/SCCIteratorTest.cpp
Duncan Sands
baldrick at free.fr
Thu Jul 28 07:33:01 PDT 2011
Author: baldrick
Date: Thu Jul 28 09:33:01 2011
New Revision: 136353
URL: http://llvm.org/viewvc/llvm-project?rev=136353&view=rev
Log:
Check an additional property specific to the way LLVM
iterates over SCC's.
Modified:
llvm/trunk/unittests/ADT/SCCIteratorTest.cpp
Modified: llvm/trunk/unittests/ADT/SCCIteratorTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ADT/SCCIteratorTest.cpp?rev=136353&r1=136352&r2=136353&view=diff
==============================================================================
--- llvm/trunk/unittests/ADT/SCCIteratorTest.cpp (original)
+++ llvm/trunk/unittests/ADT/SCCIteratorTest.cpp Thu Jul 28 09:33:01 2011
@@ -322,6 +322,21 @@
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
More information about the llvm-commits
mailing list