]> granicus.if.org Git - llvm/commitdiff
[PM] Add an ASCII-art diagram for the call graph in the CGSCC unit test.
authorChandler Carruth <chandlerc@gmail.com>
Mon, 28 Nov 2016 03:40:33 +0000 (03:40 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Mon, 28 Nov 2016 03:40:33 +0000 (03:40 +0000)
No functionality changed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288013 91177308-0d34-0410-b5e6-96231b3b80d8

unittests/Analysis/CGSCCPassManagerTest.cpp

index 9e18bb1ececae4e2c82a8d591d1d7facf8b1643a..643af94674e736919017dbc3e8cf1b4b761755ad 100644 (file)
@@ -177,38 +177,55 @@ protected:
 public:
   CGSCCPassManagerTest()
       : FAM(/*DebugLogging*/ true), CGAM(/*DebugLogging*/ true),
-        MAM(/*DebugLogging*/ true), M(parseIR("define void @f() {\n"
-                                              "entry:\n"
-                                              "  call void @g()\n"
-                                              "  call void @h1()\n"
-                                              "  ret void\n"
-                                              "}\n"
-                                              "define void @g() {\n"
-                                              "entry:\n"
-                                              "  call void @g()\n"
-                                              "  call void @x()\n"
-                                              "  ret void\n"
-                                              "}\n"
-                                              "define void @h1() {\n"
-                                              "entry:\n"
-                                              "  call void @h2()\n"
-                                              "  ret void\n"
-                                              "}\n"
-                                              "define void @h2() {\n"
-                                              "entry:\n"
-                                              "  call void @h3()\n"
-                                              "  call void @x()\n"
-                                              "  ret void\n"
-                                              "}\n"
-                                              "define void @h3() {\n"
-                                              "entry:\n"
-                                              "  call void @h1()\n"
-                                              "  ret void\n"
-                                              "}\n"
-                                              "define void @x() {\n"
-                                              "entry:\n"
-                                              "  ret void\n"
-                                              "}\n")) {
+        MAM(/*DebugLogging*/ true),
+        M(parseIR(
+            // Define a module with the following call graph, where calls go
+            // out the bottom of nodes and enter the top:
+            //
+            // f
+            // |\   _
+            // | \ / |
+            // g  h1 |
+            // |  |  |
+            // |  h2 |
+            // |  |  |
+            // |  h3 |
+            // | / \_/
+            // |/
+            // x
+            //
+            "define void @f() {\n"
+            "entry:\n"
+            "  call void @g()\n"
+            "  call void @h1()\n"
+            "  ret void\n"
+            "}\n"
+            "define void @g() {\n"
+            "entry:\n"
+            "  call void @g()\n"
+            "  call void @x()\n"
+            "  ret void\n"
+            "}\n"
+            "define void @h1() {\n"
+            "entry:\n"
+            "  call void @h2()\n"
+            "  ret void\n"
+            "}\n"
+            "define void @h2() {\n"
+            "entry:\n"
+            "  call void @h3()\n"
+            "  call void @x()\n"
+            "  ret void\n"
+            "}\n"
+            "define void @h3() {\n"
+            "entry:\n"
+            "  call void @h1()\n"
+            "  ret void\n"
+            "}\n"
+            "define void @x() {\n"
+            "entry:\n"
+            "  ret void\n"
+            "}\n")) {
     MAM.registerPass([&] { return LazyCallGraphAnalysis(); });
     MAM.registerPass([&] { return FunctionAnalysisManagerModuleProxy(FAM); });
     MAM.registerPass([&] { return CGSCCAnalysisManagerModuleProxy(CGAM); });