Argyrios Kyrtzidis | c4d2c90 | 2011-02-28 19:49:42 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -analyze -analyzer-checker=core -verify -analyzer-store=region %s |
Ted Kremenek | 595c7ab | 2008-08-13 03:55:18 +0000 | [diff] [blame] | 2 | |
| 3 | // Delta-Debugging reduced preamble. |
| 4 | typedef signed char BOOL; |
| 5 | typedef unsigned int NSUInteger; |
| 6 | @class NSString, Protocol; |
| 7 | extern void NSLog(NSString *format, ...) __attribute__((format(__NSString__, 1, 2))); |
| 8 | typedef 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 Gregor | 4c4efee | 2011-06-13 16:42:53 +0000 | [diff] [blame] | 13 | @interface NSObject <NSObject> {} |
| 14 | + (id)alloc; |
| 15 | - (id)init; |
| 16 | @end |
Ted Kremenek | 595c7ab | 2008-08-13 03:55:18 +0000 | [diff] [blame] | 17 | extern id NSAllocateObject(Class aClass, NSUInteger extraBytes, NSZone *zone); |
| 18 | @interface NSValue : NSObject <NSCopying, NSCoding> - (void)getValue:(void *)value; @end |
| 19 | @class NSString, NSData; |
| 20 | typedef 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 |
| 26 | extern NSString * const NSBundleDidLoadNotification; |
| 27 | typedef struct {} NSDecimal; |
| 28 | @interface NSNetService : NSObject {} - (id)init; @end |
| 29 | extern NSString * const NSUndoManagerCheckpointNotification; |
| 30 | |
| 31 | // Test case: <rdar://problem/6145427> |
| 32 | |
| 33 | int main (int argc, const char * argv[]) { |
| 34 | NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; |
Ted Kremenek | 818b433 | 2010-09-09 22:51:55 +0000 | [diff] [blame] | 35 | id someUnintializedPointer = [someUnintializedPointer objectAtIndex:0]; // expected-warning{{Receiver in message expression is an uninitialized value}} |
Ted Kremenek | 595c7ab | 2008-08-13 03:55:18 +0000 | [diff] [blame] | 36 | NSLog(@"%@", someUnintializedPointer); |
| 37 | [pool drain]; |
| 38 | return 0; |
| 39 | } |