2012-12-22 01:27:01 +08:00
|
|
|
// RUN: %clang_cc1 -analyze -analyzer-checker=debug.DumpCallGraph %s -fblocks 2>&1 | FileCheck %s
|
2012-03-08 08:42:23 +08:00
|
|
|
|
|
|
|
static void mmm(int y) {
|
|
|
|
if (y != 0)
|
|
|
|
y++;
|
2012-12-22 01:27:01 +08:00
|
|
|
y = y/y;
|
2012-03-08 08:42:23 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static int foo(int x, int y) {
|
|
|
|
mmm(y);
|
|
|
|
if (x != 0)
|
|
|
|
x++;
|
|
|
|
return 5/x;
|
|
|
|
}
|
|
|
|
|
|
|
|
void aaa() {
|
|
|
|
foo(1,2);
|
|
|
|
}
|
|
|
|
|
2012-12-22 01:27:01 +08:00
|
|
|
void bbb(int y) {
|
|
|
|
int x = (y > 2);
|
|
|
|
^ {
|
|
|
|
foo(x, y);
|
|
|
|
}();
|
|
|
|
}
|
|
|
|
|
2012-03-08 08:42:23 +08:00
|
|
|
// CHECK:--- Call graph Dump ---
|
2012-12-22 01:27:01 +08:00
|
|
|
// 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:
|