[cfe-commits] r50219 - /cfe/trunk/test/Analysis-Apple/NSString.m
Ted Kremenek
kremenek at apple.com
Thu Apr 24 11:17:14 PDT 2008
Author: kremenek
Date: Thu Apr 24 13:17:14 2008
New Revision: 50219
URL: http://llvm.org/viewvc/llvm-project?rev=50219&view=rev
Log:
Added test case for functionality fix in rdar://problem/5886141 (handle variadic CF Create functions).
Modified:
cfe/trunk/test/Analysis-Apple/NSString.m
Modified: cfe/trunk/test/Analysis-Apple/NSString.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis-Apple/NSString.m?rev=50219&r1=50218&r2=50219&view=diff
==============================================================================
--- cfe/trunk/test/Analysis-Apple/NSString.m (original)
+++ cfe/trunk/test/Analysis-Apple/NSString.m Thu Apr 24 13:17:14 2008
@@ -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 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}}
+}
More information about the cfe-commits
mailing list