diff options
Diffstat (limited to 'test')
105 files changed, 312 insertions, 262 deletions
diff --git a/test/ARCMT/nonobjc-to-objc-cast-2.m b/test/ARCMT/nonobjc-to-objc-cast-2.m index 2900b9a1fe..ba4efd3f5a 100644 --- a/test/ARCMT/nonobjc-to-objc-cast-2.m +++ b/test/ARCMT/nonobjc-to-objc-cast-2.m @@ -20,7 +20,7 @@ void f(BOOL b) { void f2(NSString *s) { CFStringRef ref; ref = [(CFStringRef)[s string] retain]; // expected-error {{cast of Objective-C pointer type 'id' to C pointer type 'CFStringRef' (aka 'const struct __CFString *') requires a bridged cast}} \ - // expected-error {{ bad receiver type 'CFStringRef' (aka 'const struct __CFString *')}} \ + // expected-error {{bad receiver type 'CFStringRef' (aka 'const struct __CFString *')}} \ // expected-note{{use __bridge to convert directly (no change in ownership)}} \ // expected-note{{use __bridge_retained to make an ARC object available as a +1 'CFStringRef' (aka 'const struct __CFString *')}} } diff --git a/test/Analysis/CFDateGC.m b/test/Analysis/CFDateGC.m index 69b99f052b..4884bb9ea8 100644 --- a/test/Analysis/CFDateGC.m +++ b/test/Analysis/CFDateGC.m @@ -42,7 +42,7 @@ CFAbsoluteTime f1_use_after_release() { [NSMakeCollectable(date) release]; CFDateGetAbsoluteTime(date); // no-warning CFRelease(date); - t = CFDateGetAbsoluteTime(date); // expected-warning{{Reference-counted object is used after it is released.}} + t = CFDateGetAbsoluteTime(date); // expected-warning{{Reference-counted object is used after it is released}} return t; } @@ -55,7 +55,7 @@ CFAbsoluteTime f2_use_after_release() { [(id) CFMakeCollectable(date) release]; CFDateGetAbsoluteTime(date); // no-warning CFRelease(date); - t = CFDateGetAbsoluteTime(date); // expected-warning{{Reference-counted object is used after it is released.}} + t = CFDateGetAbsoluteTime(date); // expected-warning{{Reference-counted object is used after it is released}} return t; } diff --git a/test/Analysis/NSString.m b/test/Analysis/NSString.m index 48450daa01..4add37b975 100644 --- a/test/Analysis/NSString.m +++ b/test/Analysis/NSString.m @@ -97,31 +97,31 @@ extern void *_NSConstantStringClassReference; NSComparisonResult f1(NSString* s) { NSString *aString = 0; - return [s compare:aString]; // expected-warning {{Argument to 'NSString' method 'compare:' cannot be nil.}} + return [s compare:aString]; // expected-warning {{Argument to 'NSString' method 'compare:' cannot be nil}} } NSComparisonResult f2(NSString* s) { NSString *aString = 0; - return [s caseInsensitiveCompare:aString]; // expected-warning {{Argument to 'NSString' method 'caseInsensitiveCompare:' cannot be nil.}} + return [s caseInsensitiveCompare:aString]; // expected-warning {{Argument to 'NSString' method 'caseInsensitiveCompare:' cannot be nil}} } NSComparisonResult f3(NSString* s, NSStringCompareOptions op) { NSString *aString = 0; - return [s compare:aString options:op]; // expected-warning {{Argument to 'NSString' method 'compare:options:' cannot be nil.}} + return [s compare:aString options:op]; // expected-warning {{Argument to 'NSString' method 'compare:options:' cannot be nil}} } NSComparisonResult f4(NSString* s, NSStringCompareOptions op, NSRange R) { NSString *aString = 0; - return [s compare:aString options:op range:R]; // expected-warning {{Argument to 'NSString' method 'compare:options:range:' cannot be nil.}} + return [s compare:aString options:op range:R]; // expected-warning {{Argument to 'NSString' method 'compare:options:range:' cannot be nil}} } NSComparisonResult f5(NSString* s, NSStringCompareOptions op, NSRange R) { NSString *aString = 0; - return [s compare:aString options:op range:R locale:0]; // expected-warning {{Argument to 'NSString' method 'compare:options:range:locale:' cannot be nil.}} + return [s compare:aString options:op range:R locale:0]; // expected-warning {{Argument to 'NSString' method 'compare:options:range:locale:' cannot be nil}} } NSArray *f6(NSString* s) { - return [s componentsSeparatedByCharactersInSet:0]; // expected-warning {{Argument to 'NSString' method 'componentsSeparatedByCharactersInSet:' cannot be nil.}} + return [s componentsSeparatedByCharactersInSet:0]; // expected-warning {{Argument to 'NSString' method 'componentsSeparatedByCharactersInSet:' cannot be nil}} } NSString* f7(NSString* s1, NSString* s2, NSString* s3) { @@ -189,7 +189,7 @@ void f13(void) { @end void f14(MyString *s) { - [s compare:0]; // expected-warning {{Argument to 'MyString' method 'compare:' cannot be nil.}} + [s compare:0]; // expected-warning {{Argument to 'MyString' method 'compare:' cannot be nil}} } // Test regular use of -autorelease diff --git a/test/Analysis/method-arg-decay.m b/test/Analysis/method-arg-decay.m index 9ce88b2423..ffe28afc4d 100644 --- a/test/Analysis/method-arg-decay.m +++ b/test/Analysis/method-arg-decay.m @@ -73,7 +73,7 @@ extern NSMutableArray *XCFindPossibleKeyModules(PBXModule *module, BOOL useExpos - (PBXModule *) moduleForTab:(NSTabViewItem *)item; // expected-note {{method definition for 'moduleForTab:' not found}} @end @implementation XCPerspectiveModule // expected-warning {{incomplete implementation}} \ - // expected-warning {{method in protocol not implemented [-Wprotocol]}} + // expected-warning {{method in protocol not implemented}} + (void) openForProjectDocument:(PBXProjectDocument *)projectDocument { } - (PBXModule *) type:(Class)type inPerspective:(id)perspectiveIdentifer matchingFunction:(BOOL (void *, void *))comparator usingData:(void *)data { diff --git a/test/Analysis/retain-release-path-notes-gc.m b/test/Analysis/retain-release-path-notes-gc.m index 19e6d7b8b3..1e74f003e1 100644 --- a/test/Analysis/retain-release-path-notes-gc.m +++ b/test/Analysis/retain-release-path-notes-gc.m @@ -45,9 +45,9 @@ void creationViaCFCreate () { void makeCollectable () { CFTypeRef leaked = CFCreateSomething(); // expected-warning{{leak}} expected-note{{Call to function 'CFCreateSomething' returns a Core Foundation object with a +1 retain count. Core Foundation objects are not automatically garbage collected}} CFRetain(leaked); // expected-note{{Reference count incremented. The object now has a +2 retain count}} - CFMakeCollectable(leaked); // expected-note{{In GC mode a call to 'CFMakeCollectable' decrements an object's retain count and registers the object with the garbage collector. An object must have a 0 retain count to be garbage collected. After this call its retain count is +1.}} + CFMakeCollectable(leaked); // expected-note{{In GC mode a call to 'CFMakeCollectable' decrements an object's retain count and registers the object with the garbage collector. An object must have a 0 retain count to be garbage collected. After this call its retain count is +1}} NSMakeCollectable(leaked); // expected-note{{In GC mode a call to 'NSMakeCollectable' decrements an object's retain count and registers the object with the garbage collector. Since it now has a 0 retain count the object can be automatically collected by the garbage collector}} - CFRetain(leaked); // expected-note{{Reference count incremented. The object now has a +1 retain count. The object is not eligible for garbage collection until the retain count reaches 0 again.}} + CFRetain(leaked); // expected-note{{Reference count incremented. The object now has a +1 retain count. The object is not eligible for garbage collection until the retain count reaches 0 again}} return; // expected-note{{Object leaked: object allocated and stored into 'leaked' is not referenced later in this execution path and has a retain count of +1}} } @@ -61,12 +61,12 @@ void retainReleaseIgnored () { @implementation Foo (FundamentalRuleUnderGC) - (id)getViolation { - id object = (id) CFCreateSomething(); // expected-warning{{leak}} expected-note{{Call to function 'CFCreateSomething' returns a Core Foundation object with a +1 retain count. Core Foundation objects are not automatically garbage collected.}} + id object = (id) CFCreateSomething(); // expected-warning{{leak}} expected-note{{Call to function 'CFCreateSomething' returns a Core Foundation object with a +1 retain count. Core Foundation objects are not automatically garbage collected}} return object; // expected-note{{Object returned to caller as an owning reference (single retain count transferred to caller)}} expected-note{{Object leaked: object allocated and stored into 'object' and returned from method 'getViolation' is potentially leaked when using garbage collection. Callers of this method do not expect a returned object with a +1 retain count since they expect the object to be managed by the garbage collector}} } - (id)copyViolation { - id object = (id) CFCreateSomething(); // expected-warning{{leak}} expected-note{{Call to function 'CFCreateSomething' returns a Core Foundation object with a +1 retain count. Core F |