diff options
author | Ted Kremenek <kremenek@apple.com> | 2010-02-16 16:55:10 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2010-02-16 16:55:10 +0000 |
commit | 6418825fb8934128e847d17b0d0a171dcca32e9b (patch) | |
tree | e43e78c7ab457d0cc57f6854f8635d9cc2a6224b | |
parent | 61814f6a24c173a552ac147160979114289897cf (diff) |
Add test case showing that a recursive block that captures a block pointer that
isn't marked '__block' is bad.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96357 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | test/Analysis/blocks.m | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/Analysis/blocks.m b/test/Analysis/blocks.m index e8e96a22cf..b05b198c54 100644 --- a/test/Analysis/blocks.m +++ b/test/Analysis/blocks.m @@ -83,3 +83,8 @@ void test2_b() { // 'x' is bound at block creation. ^{ y = x + 1; }(); // no-warning } + +void test2_c() { + typedef void (^myblock)(void); + myblock f = ^() { f(); }; // expected-warning{{Variable 'f' is captured by block with a garbage value}} +}
\ No newline at end of file |