]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/Analysis/uninit-ps-rdar6145427.m
Vendor import of clang release_30 branch r142614:
[FreeBSD/FreeBSD.git] / test / Analysis / uninit-ps-rdar6145427.m
1 // RUN: %clang_cc1 -analyze -analyzer-checker=core -verify -analyzer-store=region %s
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
13 @interface NSObject <NSObject> {} 
14 + (id)alloc; 
15 - (id)init;
16 @end
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];
35   id someUnintializedPointer = [someUnintializedPointer objectAtIndex:0]; // expected-warning{{Receiver in message expression is an uninitialized value}}
36   NSLog(@"%@", someUnintializedPointer);    
37   [pool drain];
38   return 0;
39 }