Added test case for functionality fix in rdar://problem/5886141 (handle variadic CF Create functions).

llvm-svn: 50219
This commit is contained in:
Ted Kremenek 2008-04-24 18:17:14 +00:00
parent f7c3979bb0
commit 78120c8b3a
1 changed files with 12 additions and 1 deletions

View File

@ -1,5 +1,6 @@
// RUN: clang -checker-simple -verify %s
// RUN: clang -checker-cfref -verify %s
#include <CoreFoundation/CFString.h>
#include <Foundation/NSString.h>
#include <Foundation/NSObjCRuntime.h>
#include <Foundation/NSArray.h>
@ -32,3 +33,13 @@ NSComparisonResult f5(NSString* s, NSStringCompareOptions op, NSRange R) {
NSComparisonResult f6(NSString* s) {
return [s componentsSeparatedByCharactersInSet:nil]; // expected-warning {{Argument to 'NSString' method 'componentsSeparatedByCharactersInSet:' cannot be nil.}}
}
NSString* f7(NSString* s1, NSString* s2, NSString* s3) {
NSString* s4 = CFStringCreateWithFormat(kCFAllocatorDefault, NULL,
L"%@ %@ (%@)",
s1, s2, s3);
CFRetain(s4);
return s4; // expected-warning{{leak}}
}