2010-02-05 04:52:40 +03:00
|
|
|
// RUN: %clang_cc1 -analyze -analyzer-experimental-internal-checks -analyzer-check-dead-stores -verify %s
|
2009-01-31 00:35:30 +03:00
|
|
|
//
|
|
|
|
// This test exercises the live variables analysis (LiveVariables.cpp).
|
|
|
|
// The case originally identified a non-termination bug.
|
|
|
|
//
|
|
|
|
typedef signed char BOOL;
|
|
|
|
typedef unsigned int NSUInteger;
|
|
|
|
typedef struct _NSZone NSZone;
|
|
|
|
@protocol NSObject - (BOOL)isEqual:(id)object; @end
|
|
|
|
@interface NSObject <NSObject> {} @end
|
|
|
|
extern id NSAllocateObject(Class aClass, NSUInteger extraBytes, NSZone *zone);
|
|
|
|
@class NSArray;
|
|
|
|
@class NSMutableArray, NSIndexSet, NSView, NSPredicate, NSString, NSViewAnimation, NSTimer;
|
|
|
|
@interface FooBazController : NSObject {}
|
|
|
|
@end
|
|
|
|
typedef struct {} TazVersion;
|
|
|
|
@class TazNode;
|
|
|
|
@interface TazGuttenberg : NSObject {} typedef NSUInteger BugsBunnyType; @end
|
|
|
|
@interface FooBaz : NSObject {}
|
|
|
|
@property (nonatomic) BugsBunnyType matchType;
|
|
|
|
@property (nonatomic, retain) NSArray *papyrus; @end
|
|
|
|
@implementation FooBazController
|
|
|
|
- (NSArray *)excitingStuff:(FooBaz *)options {
|
|
|
|
BugsBunnyType matchType = options.matchType;
|
2009-05-09 03:45:49 +04:00
|
|
|
NSPredicate *isSearchablePredicate = [NSPredicate predicateWithFormat:@"isSearchable == YES"]; // expected-warning{{receiver 'NSPredicate' is a forward class and corresponding}} // expected-warning{{return type defaults to 'id'}}
|
2009-01-31 00:35:30 +03:00
|
|
|
for (TazGuttenberg *Guttenberg in options.papyrus) {
|
|
|
|
NSArray *GuttenbergNodes = [Guttenberg nodes]; // expected-warning{{return type defaults to 'id'}}
|
|
|
|
NSArray *searchableNodes = [GuttenbergNodes filteredArrayUsingPredicate:isSearchablePredicate]; // expected-warning{{return type defaults to 'id'}}
|
|
|
|
for (TazNode *node in searchableNodes) {
|
|
|
|
switch (matchType) {
|
|
|
|
default: break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2009-07-21 22:56:04 +04:00
|
|
|
while (1) {}
|
2009-01-31 00:35:30 +03:00
|
|
|
}
|
|
|
|
@end
|