diff options
author | Ed Schouten <ed@FreeBSD.org> | 2009-06-02 17:58:47 +0000 |
---|---|---|
committer | Ed Schouten <ed@FreeBSD.org> | 2009-06-02 17:58:47 +0000 |
commit | ec2b103c267a06a66e926f62cd96767b280f5cf5 (patch) | |
tree | ce7d964cbb5e39695b71481698f10cb099c23d4a /test/Analysis/uninit-ps-rdar6145427.m | |
download | src-ec2b103c267a06a66e926f62cd96767b280f5cf5.tar.gz src-ec2b103c267a06a66e926f62cd96767b280f5cf5.zip |
Notes
Diffstat (limited to 'test/Analysis/uninit-ps-rdar6145427.m')
-rw-r--r-- | test/Analysis/uninit-ps-rdar6145427.m | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/test/Analysis/uninit-ps-rdar6145427.m b/test/Analysis/uninit-ps-rdar6145427.m new file mode 100644 index 000000000000..49eb26984a0b --- /dev/null +++ b/test/Analysis/uninit-ps-rdar6145427.m @@ -0,0 +1,37 @@ +// RUN: clang-cc -analyze -verify -analyzer-store=basic -checker-cfref %s && +// RUN: clang-cc -analyze -verify -analyzer-store=region -checker-cfref %s + +// Delta-Debugging reduced preamble. +typedef signed char BOOL; +typedef unsigned int NSUInteger; +@class NSString, Protocol; +extern void NSLog(NSString *format, ...) __attribute__((format(__NSString__, 1, 2))); +typedef struct _NSZone NSZone; +@class NSInvocation, NSMethodSignature, NSCoder, NSString, NSEnumerator; +@protocol NSObject - (BOOL)isEqual:(id)object; @end +@protocol NSCopying - (id)copyWithZone:(NSZone *)zone; @end +@protocol NSCoding - (void)encodeWithCoder:(NSCoder *)aCoder; @end +@interface NSObject <NSObject> {} + (id)alloc; @end +extern id NSAllocateObject(Class aClass, NSUInteger extraBytes, NSZone *zone); +@interface NSValue : NSObject <NSCopying, NSCoding> - (void)getValue:(void *)value; @end +@class NSString, NSData; +typedef struct _NSPoint {} NSRange; +@interface NSValue (NSValueRangeExtensions) ++ (NSValue *)valueWithRange:(NSRange)range; +- (id)objectAtIndex:(NSUInteger)index; +@end +@interface NSAutoreleasePool : NSObject {} - (void)drain; @end +extern NSString * const NSBundleDidLoadNotification; +typedef struct {} NSDecimal; +@interface NSNetService : NSObject {} - (id)init; @end +extern NSString * const NSUndoManagerCheckpointNotification; + +// Test case: <rdar://problem/6145427> + +int main (int argc, const char * argv[]) { + NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; + id someUnintializedPointer = [someUnintializedPointer objectAtIndex:0]; // expected-warning{{Receiver in message expression is an uninitialized value.}} + NSLog(@"%@", someUnintializedPointer); + [pool drain]; + return 0; +} |