summaryrefslogtreecommitdiff
path: root/unittests
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2014-04-24 09:59:56 +0000
committerChandler Carruth <chandlerc@gmail.com>2014-04-24 09:59:56 +0000
commit9e9ec347602a40f82e6f5f4935908c0c8eb448a7 (patch)
treecc3d553c3e88373b874375ceb9d6911a13b3279d /unittests
parentfd46b84dddfdb736b7d3c70d17ee934b6cbb39f8 (diff)
downloadllvm-9e9ec347602a40f82e6f5f4935908c0c8eb448a7.tar.gz
llvm-9e9ec347602a40f82e6f5f4935908c0c8eb448a7.tar.bz2
llvm-9e9ec347602a40f82e6f5f4935908c0c8eb448a7.tar.xz
[LCG] Re-order expectations to provide more useful output when debugging
an issue. This way you see that the number of nodes was wrong before a crash due to accessing too many nodes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207094 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r--unittests/Analysis/LazyCallGraphTest.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/unittests/Analysis/LazyCallGraphTest.cpp b/unittests/Analysis/LazyCallGraphTest.cpp
index 781d98ee50..058027f2e1 100644
--- a/unittests/Analysis/LazyCallGraphTest.cpp
+++ b/unittests/Analysis/LazyCallGraphTest.cpp
@@ -209,40 +209,40 @@ TEST(LazyCallGraphTest, BasicGraphFormation) {
for (LazyCallGraph::Node *N : D)
Nodes.push_back(N->getFunction().getName());
std::sort(Nodes.begin(), Nodes.end());
+ EXPECT_EQ(3u, Nodes.size());
EXPECT_EQ("d1", Nodes[0]);
EXPECT_EQ("d2", Nodes[1]);
EXPECT_EQ("d3", Nodes[2]);
- EXPECT_EQ(3u, Nodes.size());
Nodes.clear();
LazyCallGraph::SCC &C = *SCCI++;
for (LazyCallGraph::Node *N : C)
Nodes.push_back(N->getFunction().getName());
std::sort(Nodes.begin(), Nodes.end());
+ EXPECT_EQ(3u, Nodes.size());
EXPECT_EQ("c1", Nodes[0]);
EXPECT_EQ("c2", Nodes[1]);
EXPECT_EQ("c3", Nodes[2]);
- EXPECT_EQ(3u, Nodes.size());
Nodes.clear();
LazyCallGraph::SCC &B = *SCCI++;
for (LazyCallGraph::Node *N : B)
Nodes.push_back(N->getFunction().getName());
std::sort(Nodes.begin(), Nodes.end());
+ EXPECT_EQ(3u, Nodes.size());
EXPECT_EQ("b1", Nodes[0]);
EXPECT_EQ("b2", Nodes[1]);
EXPECT_EQ("b3", Nodes[2]);
- EXPECT_EQ(3u, Nodes.size());
Nodes.clear();
LazyCallGraph::SCC &A = *SCCI++;
for (LazyCallGraph::Node *N : A)
Nodes.push_back(N->getFunction().getName());
std::sort(Nodes.begin(), Nodes.end());
+ EXPECT_EQ(3u, Nodes.size());
EXPECT_EQ("a1", Nodes[0]);
EXPECT_EQ("a2", Nodes[1]);
EXPECT_EQ("a3", Nodes[2]);
- EXPECT_EQ(3u, Nodes.size());
Nodes.clear();
EXPECT_EQ(CG.postorder_scc_end(), SCCI);