blob: 9354acb0109b0a07d18956c6f7b79a1c0c1bf78a [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 {
Mike Stump3a3c6242009-07-21 18:58:50 +000048 return 0;
Ted Kremenek868210e2009-04-21 23:53:32 +000049}
50
51//===----------------------------------------------------------------------===//
52// Actual test case:
53//
54// The analyzer currently doesn't reason about ObjCKVCRefExpr. Have both
55// GRExprEngine::Visit and GRExprEngine::VisitLValue have such expressions
56// evaluate to UnknownVal.
57//===----------------------------------------------------------------------===//
58
59- (void)docListListFetchTicket:(GDataServiceTicket *)ticket finishedWithFeed:(GDataFeedDocList *)feed {
60 BOOL doGetDir = self.directoryPathComponents != 0 && self.currentPathComponentIndex < [self.directoryPathComponents count];
61 if (doGetDir) {
62 BOOL isDirExisting = [[self.feedDocList entries] count] > 0;
63 if (isDirExisting) {
64 if (self.folderFeedURL != 0) {
65 if (++self.currentPathComponentIndex == [self.directoryPathComponents count]) {
66 }
67 }
68 }
69 }
70}