summaryrefslogtreecommitdiffstats
path: root/clang/test/Analysis/traversal-begin-end-function.c
diff options
context:
space:
mode:
authorDevin Coughlin <dcoughlin@apple.com>2016-02-19 01:35:10 +0000
committerDevin Coughlin <dcoughlin@apple.com>2016-02-19 01:35:10 +0000
commit8d922aa746a1cdf951dc12f43b86139c68f23e57 (patch)
treeff80bda6a69d3002abbdfd870422c1f117b58d88 /clang/test/Analysis/traversal-begin-end-function.c
parentbde5ede5261062a838d57651ace09c35d3ebcdc8 (diff)
downloadbcm5719-llvm-8d922aa746a1cdf951dc12f43b86139c68f23e57.tar.gz
bcm5719-llvm-8d922aa746a1cdf951dc12f43b86139c68f23e57.zip
[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
Diffstat (limited to 'clang/test/Analysis/traversal-begin-end-function.c')
-rw-r--r--clang/test/Analysis/traversal-begin-end-function.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/clang/test/Analysis/traversal-begin-end-function.c b/clang/test/Analysis/traversal-begin-end-function.c
new file mode 100644
index 00000000000..810ce1d2a52
--- /dev/null
+++ b/clang/test/Analysis/traversal-begin-end-function.c
@@ -0,0 +1,22 @@
+// 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);
+}
OpenPOWER on IntegriCloud