diff options
Diffstat (limited to 'test/ARCMT/checking.m')
-rw-r--r-- | test/ARCMT/checking.m | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ARCMT/checking.m b/test/ARCMT/checking.m index 7ab54ceb05..2e4ec122d6 100644 --- a/test/ARCMT/checking.m +++ b/test/ARCMT/checking.m @@ -36,10 +36,16 @@ struct UnsafeS { - (oneway void)release { } // expected-error {{ARC forbids implementation}} @end +id global_foo; + void test1(A *a, BOOL b, struct UnsafeS *unsafeS) { [unsafeS->unsafeObj retain]; // expected-error {{it is not safe to remove 'retain' message on an __unsafe_unretained type}} \ // expected-error {{ARC forbids explicit message send}} id foo = [unsafeS->unsafeObj retain]; // no warning. + [global_foo retain]; // expected-error {{it is not safe to remove 'retain' message on a global variable}} \ + // expected-error {{ARC forbids explicit message send}} + [global_foo release]; // expected-error {{it is not safe to remove 'release' message on a global variable}} \ + // expected-error {{ARC forbids explicit message send}} [a dealloc]; [a retain]; [a retainCount]; // expected-error {{ARC forbids explicit message send of 'retainCount'}} |