summaryrefslogtreecommitdiffstats
path: root/clang/test/Analysis/debug-CallGraph.c
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2014-12-17 00:34:07 +0000
committerAnna Zaks <ganna@apple.com>2014-12-17 00:34:07 +0000
commit87d404d4580be4005af4b6be6221e8e8b3814ac0 (patch)
tree512a00aaf6548bf3fd25a919580fe08e054779f6 /clang/test/Analysis/debug-CallGraph.c
parent04b69f89aaf547d973353e49b2ada5bcd7a58972 (diff)
downloadbcm5719-llvm-87d404d4580be4005af4b6be6221e8e8b3814ac0.tar.gz
bcm5719-llvm-87d404d4580be4005af4b6be6221e8e8b3814ac0.zip
[CallGraph] Make sure the edges are not missed due to re-declarations
A patch by Daniel DeFreez! We were previously dropping edges on re-declarations. Store the canonical declarations in the graph to ensure that different references to the same function end up reflected with the same call graph node. (Note, this might lead to performance fluctuation because call graph is used to determine the function analysis order.) llvm-svn: 224398
Diffstat (limited to 'clang/test/Analysis/debug-CallGraph.c')
-rw-r--r--clang/test/Analysis/debug-CallGraph.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/clang/test/Analysis/debug-CallGraph.c b/clang/test/Analysis/debug-CallGraph.c
index 4523c789351..64259e2069a 100644
--- a/clang/test/Analysis/debug-CallGraph.c
+++ b/clang/test/Analysis/debug-CallGraph.c
@@ -23,11 +23,22 @@ void bbb(int y) {
foo(x, y);
}();
}
+void ccc();
+void ddd() { ccc(); }
+void ccc() {}
+
+void eee();
+void eee() {}
+void fff() { eee(); }
// CHECK:--- Call graph Dump ---
-// CHECK: Function: < root > calls: mmm foo aaa < > bbb
-// CHECK: Function: bbb calls: < >
-// CHECK: Function: < > calls: foo
-// CHECK: Function: aaa calls: foo
-// CHECK: Function: foo calls: mmm
-// CHECK: Function: mmm calls:
+// CHECK-NEXT: {{Function: < root > calls: mmm foo aaa < > bbb ccc ddd eee fff $}}
+// CHECK-NEXT: {{Function: fff calls: eee $}}
+// CHECK-NEXT: {{Function: eee calls: $}}
+// CHECK-NEXT: {{Function: ddd calls: ccc $}}
+// CHECK-NEXT: {{Function: ccc calls: $}}
+// CHECK-NEXT: {{Function: bbb calls: < > $}}
+// CHECK-NEXT: {{Function: < > calls: foo $}}
+// CHECK-NEXT: {{Function: aaa calls: foo $}}
+// CHECK-NEXT: {{Function: foo calls: mmm $}}
+// CHECK-NEXT: {{Function: mmm calls: $}}
OpenPOWER on IntegriCloud