diff options
author | Zhongxing Xu <xuzhongxing@gmail.com> | 2010-03-04 09:04:52 +0000 |
---|---|---|
committer | Zhongxing Xu <xuzhongxing@gmail.com> | 2010-03-04 09:04:52 +0000 |
commit | 5cb8d9d40f15058e96e9327dc15b0962b1cfe060 (patch) | |
tree | 3391f84d499c8cca5efca6965f772600e771dc68 /clang/test/Analysis/inline3.c | |
parent | 1a7ed5868b754c31aabc5614fe6dd0535b095904 (diff) | |
download | bcm5719-llvm-5cb8d9d40f15058e96e9327dc15b0962b1cfe060.tar.gz bcm5719-llvm-5cb8d9d40f15058e96e9327dc15b0962b1cfe060.zip |
When profiling Environment, also profile with AnalysisContext*, bacause
we now may have identical states with different analysis context.
Set the right AnalysisContext in state when entering and leaving a callee.
With both of the above changes, we can pass the test case.
llvm-svn: 97724
Diffstat (limited to 'clang/test/Analysis/inline3.c')
-rw-r--r-- | clang/test/Analysis/inline3.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/test/Analysis/inline3.c b/clang/test/Analysis/inline3.c new file mode 100644 index 00000000000..3661263b6ba --- /dev/null +++ b/clang/test/Analysis/inline3.c @@ -0,0 +1,15 @@ +// RUN: %clang_cc1 -analyze -inline-call -analyzer-store region -analyze-function f2 -verify %s + + +// Test when entering f1(), we set the right AnalysisContext to Environment. +// Otherwise, block-level expr '1 && a' would not be block-level. +int a; + +void f1() { + if (1 && a) + return; +} + +void f2() { + f1(); +} |