diff options
author | Jordan Rose <jordan_rose@apple.com> | 2012-07-02 19:27:35 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2012-07-02 19:27:35 +0000 |
commit | 740d490593e0de8732a697c9f77b90ddd463863b (patch) | |
tree | 1c4003bd0e0d2be292345e6ac90af5628e1734c0 /test | |
parent | 7518b3784ed2176aad8dcabe0685c6e02c5f1043 (diff) | |
download | clang-740d490593e0de8732a697c9f77b90ddd463863b.tar.gz |
[analyzer] Add a new abstraction over all types of calls: CallEvent
This is intended to replace CallOrObjCMessage, and is eventually intended to be
used for anything that cares more about /what/ is being called than /how/ it's
being called. For example, inlining destructors should be the same as inlining
blocks, and checking __attribute__((nonnull)) should apply to the allocator
calls generated by operator new.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159554 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/Analysis/blocks-no-inline.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/Analysis/blocks-no-inline.c b/test/Analysis/blocks-no-inline.c new file mode 100644 index 0000000000..1ec14e820b --- /dev/null +++ b/test/Analysis/blocks-no-inline.c @@ -0,0 +1,13 @@ +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -analyze -analyzer-checker=core,debug.ExprInspection -analyzer-ipa=none -fblocks -verify %s + +void clang_analyzer_eval(int); + +void testInvalidation() { + __block int i = 0; + ^{ + ++i; + }(); + + // Under inlining, we will know that i == 1. + clang_analyzer_eval(i == 0); // expected-warning{{UNKNOWN}} +} |