• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %clang_analyze_cc1 -analyzer-checker=debug.DumpCallGraph %s 2>&1 | FileCheck %s
2 
aaa()3 static int aaa() {
4   return 0;
5 }
6 
bbb(int param=aaa ())7 static int bbb(int param=aaa()) {
8   return 1;
9 }
10 
11 int ddd();
12 
13 struct c {
cc14   c(int param=2) : val(bbb(param)) {}
15   int val;
16   int val2 = ddd();
17 };
18 
ddd()19 int ddd() {
20   c c;
21   return bbb();
22 }
23 
24 // CHECK:--- Call graph Dump ---
25 // CHECK-NEXT: {{Function: < root > calls: aaa bbb c::c ddd}}
26 // CHECK-NEXT: {{Function: c::c calls: bbb ddd $}}
27 // CHECK-NEXT: {{Function: ddd calls: c::c bbb aaa $}}
28 // CHECK-NEXT: {{Function: bbb calls: $}}
29 // CHECK-NEXT: {{Function: aaa calls: $}}
30