blob: 036a46db0600b5cf5c28dfb3eaef073c18db8f3f [file] [log] [blame]
Ted Kremenek868210e2009-04-21 23:53:32 +00001// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -verify -triple x86_64-apple-darwin9 %s &&
Ted Kremenekc037eac2009-07-10 00:41:58 +00002// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic-old-cast -analyzer-constraints=basic -verify -triple x86_64-apple-darwin9 %s &&
Ted Kremenek868210e2009-04-21 23:53:32 +00003// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify -triple x86_64-apple-darwin9 %s &&
Ted Kremenekc037eac2009-07-10 00:41:58 +00004// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic-old-cast -analyzer-constraints=range -verify -triple x86_64-apple-darwin9 %s &&
Ted Kremenek868210e2009-04-21 23:53:32 +00005// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify -triple x86_64-apple-darwin9 %s &&
6// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify -triple x86_64-apple-darwin9 %s
7
8//===----------------------------------------------------------------------===//
9// Delta-debugging produced forward declarations.
10//===----------------------------------------------------------------------===//
11
12typedef signed char BOOL;
13typedef struct _NSZone NSZone;
14@class NSInvocation, NSMethodSignature, NSCoder, NSString, NSEnumerator;
15@protocol NSObject - (BOOL)isEqual:(id)object;
16@end @protocol NSCopying - (id)copyWithZone:(NSZone *)zone;
17@end @protocol NSMutableCopying - (id)mutableCopyWithZone:(NSZone *)zone;
18@end @protocol NSCoding - (void)encodeWithCoder:(NSCoder *)aCoder;
19@end @interface NSObject <NSObject> {
20}
21@end extern id <NSObject> NSAllocateObject(Class aClass, unsigned extraBytes, NSZone *zone);
22@interface NSArray : NSObject <NSCopying, NSMutableCopying, NSCoding> - (unsigned)count;
23@end @class NSTimer, NSPort, NSArray;
24@class NSURLHandle, NSMutableArray, NSMutableData, NSData, NSURL;
25@interface NSResponder : NSObject <NSCoding> {
26}
27@end @class NSBitmapImageRep, NSCursor, NSGraphicsContext, NSImage, NSPasteboard, NSScrollView, NSWindow, NSAttributedString;
28@interface NSView : NSResponder {
29 struct __VFlags2 {
30 }
31 _vFlags2;
32}
33@end @class NSTextField, NSPanel, NSArray, NSWindow, NSImage, NSButton, NSError;
34@interface NSBox : NSView {
35}
36@end @class GDataFeedDocList, GDataServiceTicket, GDataServiceTicket, IHGoogleDocsAdapter;
37@protocol IHGoogleDocsAdapterDelegate - (void)googleDocsAdapter:(IHGoogleDocsAdapter*)inGoogleDocsAdapter accountVerifyIsValid:(BOOL)inIsValid error:(NSError *)inError;
38@end @interface IHGoogleDocsAdapter : NSObject {
39}
40- (NSArray *)entries;
41@end extern Class const kGDataUseRegisteredClass ;
42@interface IHGoogleDocsAdapter () - (GDataFeedDocList *)feedDocList;
43- (NSArray *)directoryPathComponents;
44- (unsigned int)currentPathComponentIndex;
45- (void)setCurrentPathComponentIndex:(unsigned int)aCurrentPathComponentIndex;
46- (NSURL *)folderFeedURL;
47@end @implementation IHGoogleDocsAdapter - (id)initWithUsername:(NSString *)inUsername password:(NSString *)inPassword owner:(NSObject <IHGoogleDocsAdapterDelegate> *)owner {
48}
49
50//===----------------------------------------------------------------------===//
51// Actual test case:
52//
53// The analyzer currently doesn't reason about ObjCKVCRefExpr. Have both
54// GRExprEngine::Visit and GRExprEngine::VisitLValue have such expressions
55// evaluate to UnknownVal.
56//===----------------------------------------------------------------------===//
57
58- (void)docListListFetchTicket:(GDataServiceTicket *)ticket finishedWithFeed:(GDataFeedDocList *)feed {
59 BOOL doGetDir = self.directoryPathComponents != 0 && self.currentPathComponentIndex < [self.directoryPathComponents count];
60 if (doGetDir) {
61 BOOL isDirExisting = [[self.feedDocList entries] count] > 0;
62 if (isDirExisting) {
63 if (self.folderFeedURL != 0) {
64 if (++self.currentPathComponentIndex == [self.directoryPathComponents count]) {
65 }
66 }
67 }
68 }
69}