Ted Kremenek | be1fe1e | 2009-02-17 04:27:41 +0000 | [diff] [blame] | 1 | // RUN: clang -analyze -verify -analyzer-store=basic -checker-cfref %s && |
| 2 | // RUN: clang -analyze -verify -analyzer-store=region -checker-cfref %s |
Ted Kremenek | 595c7ab | 2008-08-13 03:55:18 +0000 | [diff] [blame] | 3 | |
| 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; |
| 22 | @end |
| 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; |
| 28 | |
| 29 | // Test case: <rdar://problem/6145427> |
| 30 | |
| 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); |
| 35 | [pool drain]; |
| 36 | return 0; |
| 37 | } |