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