blob: c18116f21ae5d1b38cc0b88cdaa70bb94e3fee92 [file] [log] [blame]
Argyrios Kyrtzidisc4d2c902011-02-28 19:49:42 +00001// RUN: %clang_cc1 -analyze -analyzer-checker=core -verify -analyzer-store=region %s
Ted Kremenek595c7ab2008-08-13 03:55:18 +00002
3// Delta-Debugging reduced preamble.
4typedef signed char BOOL;
5typedef unsigned int NSUInteger;
6@class NSString, Protocol;
7extern void NSLog(NSString *format, ...) __attribute__((format(__NSString__, 1, 2)));
8typedef struct _NSZone NSZone;
9@class NSInvocation, NSMethodSignature, NSCoder, NSString, NSEnumerator;
10@protocol NSObject - (BOOL)isEqual:(id)object; @end
11@protocol NSCopying - (id)copyWithZone:(NSZone *)zone; @end
12@protocol NSCoding - (void)encodeWithCoder:(NSCoder *)aCoder; @end
Douglas Gregor4c4efee2011-06-13 16:42:53 +000013@interface NSObject <NSObject> {}
14+ (id)alloc;
15- (id)init;
16@end
Ted Kremenek595c7ab2008-08-13 03:55:18 +000017extern id NSAllocateObject(Class aClass, NSUInteger extraBytes, NSZone *zone);
18@interface NSValue : NSObject <NSCopying, NSCoding> - (void)getValue:(void *)value; @end
19@class NSString, NSData;
20typedef struct _NSPoint {} NSRange;
21@interface NSValue (NSValueRangeExtensions)
22+ (NSValue *)valueWithRange:(NSRange)range;
23- (id)objectAtIndex:(NSUInteger)index;
24@end
25@interface NSAutoreleasePool : NSObject {} - (void)drain; @end
26extern NSString * const NSBundleDidLoadNotification;
27typedef struct {} NSDecimal;
28@interface NSNetService : NSObject {} - (id)init; @end
29extern NSString * const NSUndoManagerCheckpointNotification;
30
31// Test case: <rdar://problem/6145427>
32
33int main (int argc, const char * argv[]) {
34 NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
Ted Kremenek818b4332010-09-09 22:51:55 +000035 id someUnintializedPointer = [someUnintializedPointer objectAtIndex:0]; // expected-warning{{Receiver in message expression is an uninitialized value}}
Ted Kremenek595c7ab2008-08-13 03:55:18 +000036 NSLog(@"%@", someUnintializedPointer);
37 [pool drain];
38 return 0;
39}