diff options
Diffstat (limited to 'test/SemaObjC/arc.m')
-rw-r--r-- | test/SemaObjC/arc.m | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/test/SemaObjC/arc.m b/test/SemaObjC/arc.m index f463bb03b075..e90d0a87e311 100644 --- a/test/SemaObjC/arc.m +++ b/test/SemaObjC/arc.m @@ -1,4 +1,5 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -fobjc-runtime-has-weak -fsyntax-only -fobjc-arc -fblocks -verify -Wno-objc-root-class -Wblock-capture-autoreleasing %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -fobjc-runtime-has-weak -fsyntax-only -fobjc-arc -fblocks -verify -Wno-objc-root-class %s +// RUN: not %clang_cc1 -triple x86_64-apple-darwin11 -fobjc-runtime-has-weak -fsyntax-only -fobjc-arc -fblocks -Wno-objc-root-class -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s typedef unsigned long NSUInteger; typedef const void * CFTypeRef; @@ -809,9 +810,36 @@ int garf() { TKAssertEqual(object, (id)nil); } -void block_capture_autoreleasing(A * __autoreleasing *a, A **b) { // expected-note {{declare the parameter __autoreleasing explicitly to suppress this warning}} expected-note {{declare the parameter __strong or capture a __block __strong variable to keep values alive across autorelease pools}} +void block_capture_autoreleasing(A * __autoreleasing *a, + A **b, // expected-note {{declare the parameter __autoreleasing explicitly to suppress this warning}} expected-note {{declare the parameter __strong or capture a __block __strong variable to keep values alive across autorelease pools}} + A * _Nullable *c, // expected-note {{declare the parameter __autoreleasing explicitly to suppress this warning}} expected-note {{declare the parameter __strong or capture a __block __strong variable to keep values alive across autorelease pools}} + A * _Nullable __autoreleasing *d, + A ** _Nullable e, // expected-note {{declare the parameter __autoreleasing explicitly to suppress this warning}} expected-note {{declare the parameter __strong or capture a __block __strong variable to keep values alive across autorelease pools}} + A * __autoreleasing * _Nullable f, + id __autoreleasing *g, + id *h, // expected-note {{declare the parameter __autoreleasing explicitly to suppress this warning}} expected-note {{declare the parameter __strong or capture a __block __strong variable to keep values alive across autorelease pools}} + id _Nullable *i, // expected-note {{declare the parameter __autoreleasing explicitly to suppress this warning}} expected-note {{declare the parameter __strong or capture a __block __strong variable to keep values alive across autorelease pools}} + id _Nullable __autoreleasing *j, + id * _Nullable k, // expected-note {{declare the parameter __autoreleasing explicitly to suppress this warning}} expected-note {{declare the parameter __strong or capture a __block __strong variable to keep values alive across autorelease pools}} + id __autoreleasing * _Nullable l) { + // CHECK: fix-it:"{{.*}}":{[[@LINE-11]]:37-[[@LINE-11]]:37}:" __autoreleasing " + // CHECK: fix-it:"{{.*}}":{[[@LINE-11]]:47-[[@LINE-11]]:47}:" __autoreleasing" + // CHECK: fix-it:"{{.*}}":{[[@LINE-10]]:37-[[@LINE-10]]:37}:" __autoreleasing " + // CHECK: fix-it:"{{.*}}":{[[@LINE-8]]:36-[[@LINE-8]]:36}:" __autoreleasing" + // CHECK: fix-it:"{{.*}}":{[[@LINE-8]]:46-[[@LINE-8]]:46}:" __autoreleasing" + // CHECK: fix-it:"{{.*}}":{[[@LINE-7]]:36-[[@LINE-7]]:36}:" __autoreleasing" ^{ (void)*a; (void)*b; // expected-warning {{block captures an autoreleasing out-parameter, which may result in use-after-free bugs}} + (void)*c; // expected-warning {{block captures an autoreleasing out-parameter, which may result in use-after-free bugs}} + (void)*d; + (void)*e; // expected-warning {{block captures an autoreleasing out-parameter, which may result in use-after-free bugs}} + (void)*f; + (void)*g; + (void)*h; // expected-warning {{block captures an autoreleasing out-parameter, which may result in use-after-free bugs}} + (void)*i; // expected-warning {{block captures an autoreleasing out-parameter, which may result in use-after-free bugs}} + (void)*j; + (void)*k; // expected-warning {{block captures an autoreleasing out-parameter, which may result in use-after-free bugs}} + (void)*l; }(); } |