1 // RUN: %clang_cc1 -analyze -verify -analyzer-store=basic -analyzer-check-objc-mem %s
2 // RUN: %clang_cc1 -analyze -verify -analyzer-store=region -analyzer-check-objc-mem %s
4 // Delta-Debugging reduced preamble.
5 typedef signed char BOOL;
6 typedef unsigned int NSUInteger;
7 @class NSString, Protocol;
8 extern void NSLog(NSString *format, ...) __attribute__((format(__NSString__, 1, 2)));
9 typedef struct _NSZone NSZone;
10 @class NSInvocation, NSMethodSignature, NSCoder, NSString, NSEnumerator;
11 @protocol NSObject - (BOOL)isEqual:(id)object; @end
12 @protocol NSCopying - (id)copyWithZone:(NSZone *)zone; @end
13 @protocol NSCoding - (void)encodeWithCoder:(NSCoder *)aCoder; @end
14 @interface NSObject <NSObject> {} + (id)alloc; @end
15 extern id NSAllocateObject(Class aClass, NSUInteger extraBytes, NSZone *zone);
16 @interface NSValue : NSObject <NSCopying, NSCoding> - (void)getValue:(void *)value; @end
17 @class NSString, NSData;
18 typedef struct _NSPoint {} NSRange;
19 @interface NSValue (NSValueRangeExtensions)
20 + (NSValue *)valueWithRange:(NSRange)range;
21 - (id)objectAtIndex:(NSUInteger)index;
23 @interface NSAutoreleasePool : NSObject {} - (void)drain; @end
24 extern NSString * const NSBundleDidLoadNotification;
25 typedef struct {} NSDecimal;
26 @interface NSNetService : NSObject {} - (id)init; @end
27 extern NSString * const NSUndoManagerCheckpointNotification;
29 // Test case: <rdar://problem/6145427>
31 int main (int argc, const char * argv[]) {
32 NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
33 id someUnintializedPointer = [someUnintializedPointer objectAtIndex:0]; // expected-warning{{Receiver in message expression is an uninitialized value}}
34 NSLog(@"%@", someUnintializedPointer);