xref: /minix3/external/bsd/llvm/dist/clang/test/Analysis/uninit-ps-rdar6145427.m (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -analyze -analyzer-checker=core -verify -analyzer-store=region %s
2*f4a2713aSLionel Sambuc
3*f4a2713aSLionel Sambuc// Delta-Debugging reduced preamble.
4*f4a2713aSLionel Sambuctypedef signed char BOOL;
5*f4a2713aSLionel Sambuctypedef unsigned int NSUInteger;
6*f4a2713aSLionel Sambuc@class NSString, Protocol;
7*f4a2713aSLionel Sambucextern void NSLog(NSString *format, ...) __attribute__((format(__NSString__, 1, 2)));
8*f4a2713aSLionel Sambuctypedef struct _NSZone NSZone;
9*f4a2713aSLionel Sambuc@class NSInvocation, NSMethodSignature, NSCoder, NSString, NSEnumerator;
10*f4a2713aSLionel Sambuc@protocol NSObject  - (BOOL)isEqual:(id)object; @end
11*f4a2713aSLionel Sambuc@protocol NSCopying  - (id)copyWithZone:(NSZone *)zone; @end
12*f4a2713aSLionel Sambuc@protocol NSCoding  - (void)encodeWithCoder:(NSCoder *)aCoder; @end
13*f4a2713aSLionel Sambuc@interface NSObject <NSObject> {}
14*f4a2713aSLionel Sambuc+ (id)alloc;
15*f4a2713aSLionel Sambuc- (id)init;
16*f4a2713aSLionel Sambuc@end
17*f4a2713aSLionel Sambucextern id NSAllocateObject(Class aClass, NSUInteger extraBytes, NSZone *zone);
18*f4a2713aSLionel Sambuc@interface NSValue : NSObject <NSCopying, NSCoding>  - (void)getValue:(void *)value; @end
19*f4a2713aSLionel Sambuc@class NSString, NSData;
20*f4a2713aSLionel Sambuctypedef struct _NSPoint {} NSRange;
21*f4a2713aSLionel Sambuc@interface NSValue (NSValueRangeExtensions)
22*f4a2713aSLionel Sambuc+ (NSValue *)valueWithRange:(NSRange)range;
23*f4a2713aSLionel Sambuc- (id)objectAtIndex:(NSUInteger)index;
24*f4a2713aSLionel Sambuc@end
25*f4a2713aSLionel Sambuc@interface NSAutoreleasePool : NSObject {} - (void)drain; @end
26*f4a2713aSLionel Sambucextern NSString * const NSBundleDidLoadNotification;
27*f4a2713aSLionel Sambuctypedef struct {} NSDecimal;
28*f4a2713aSLionel Sambuc@interface NSNetService : NSObject {} - (id)init; @end
29*f4a2713aSLionel Sambucextern NSString * const NSUndoManagerCheckpointNotification;
30*f4a2713aSLionel Sambuc
31*f4a2713aSLionel Sambuc// Test case: <rdar://problem/6145427>
32*f4a2713aSLionel Sambuc
33*f4a2713aSLionel Sambucint main (int argc, const char * argv[]) {
34*f4a2713aSLionel Sambuc  NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
35*f4a2713aSLionel Sambuc  id someUnintializedPointer = [someUnintializedPointer objectAtIndex:0]; // expected-warning{{Receiver in message expression is an uninitialized value}}
36*f4a2713aSLionel Sambuc  NSLog(@"%@", someUnintializedPointer);
37*f4a2713aSLionel Sambuc  [pool drain];
38*f4a2713aSLionel Sambuc  return 0;
39*f4a2713aSLionel Sambuc}
40