diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2014-11-24 09:15:30 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2014-11-24 09:15:30 +0000 |
commit | 9f4dbff6669c8037f3b036bcf580d14f1a4f12a5 (patch) | |
tree | 47df2c12b57214af6c31e47404b005675b8b7ffc /test/SemaObjC/warn-retain-cycle.m | |
parent | f73d5f23a889b93d89ddef61ac0995df40286bb8 (diff) |
Notes
Diffstat (limited to 'test/SemaObjC/warn-retain-cycle.m')
-rw-r--r-- | test/SemaObjC/warn-retain-cycle.m | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/test/SemaObjC/warn-retain-cycle.m b/test/SemaObjC/warn-retain-cycle.m index eb4e966c77266..4398d29e4a8cb 100644 --- a/test/SemaObjC/warn-retain-cycle.m +++ b/test/SemaObjC/warn-retain-cycle.m @@ -122,8 +122,8 @@ void doSomething(unsigned v); // Sanity check that we are really whitelisting 'addOperationWithBlock:' and not doing // something funny. [myOperationQueue addSomethingElse:^() { // expected-note {{block will be retained by an object strongly retained by the captured object}} - if (count > 20) { // expected-warning {{capturing 'self' strongly in this block is likely to lead to a retain cycle}} - doSomething(count); + if (count > 20) { + doSomething(count); // expected-warning {{capturing 'self' strongly in this block is likely to lead to a retain cycle}} } }]; } @@ -184,3 +184,17 @@ void testCopying(Test0 *obj) { })]; } +// rdar://16944538 +void func(int someCondition) { + +__block void(^myBlock)(void) = ^{ + if (someCondition) { + doSomething(1); + myBlock(); + } + else { + myBlock = ((void*)0); + } + }; + +} |