llvm-project/clang/test/Analysis/traversal-begin-end-function.c
Devin Coughlin 8d922aa746 [analyzer] Add checker callback for beginning of function.
Add a checker callback that is called when the analyzer starts analyzing a
function either at the top level or when inlined. This will be used by a
follow-on patch making the DeallocChecker path sensitive.

Differential Revision: http://reviews.llvm.org/D17418

llvm-svn: 261293
2016-02-19 01:35:10 +00:00

23 lines
481 B
C

// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.DumpTraversal %s | FileCheck %s
void inline_callee(int i);
// CHECK: --BEGIN FUNCTION--
void inline_caller() {
// CHECK: --BEGIN FUNCTION--
// CHECK: --BEGIN FUNCTION--
// CHECK: --BEGIN FUNCTION--
inline_callee(3);
// CHECK: --END FUNCTION--
// CHECK: --END FUNCTION--
// CHECK: --END FUNCTION--
}
// CHECK: --END FUNCTION--
void inline_callee(int i) {
if (i <= 1)
return;
inline_callee(i - 1);
}