diff options
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/Analysis/misc-ps-xfail.m | 64 | ||||
-rw-r--r-- | clang/test/Analysis/misc-ps.m | 31 |
2 files changed, 27 insertions, 68 deletions
diff --git a/clang/test/Analysis/misc-ps-xfail.m b/clang/test/Analysis/misc-ps-xfail.m deleted file mode 100644 index 267abb3f2fa..00000000000 --- a/clang/test/Analysis/misc-ps-xfail.m +++ /dev/null @@ -1,64 +0,0 @@ -// RUN: clang-cc -analyze -checker-cfref --analyzer-store=basic -analyzer-constraints=basic --verify -fblocks %s && -// RUN: clang-cc -analyze -checker-cfref --analyzer-store=basic -analyzer-constraints=range --verify -fblocks %s && -// RUN: clang-cc -analyze -checker-cfref --analyzer-store=region -analyzer-constraints=basic --verify -fblocks %s && -// RUN: clang-cc -analyze -checker-cfref --analyzer-store=region -analyzer-constraints=range --verify -fblocks %s -// XFAIL -typedef struct objc_ivar *Ivar; -typedef struct objc_selector *SEL; -typedef signed char BOOL; -typedef int NSInteger; -typedef unsigned int NSUInteger; -typedef struct _NSZone NSZone; -@class NSInvocation, NSArray, NSMethodSignature, NSCoder, NSString, NSEnumerator; -@protocol NSObject -- (BOOL)isEqual:(id)object; -- (id)autorelease; -@end -@protocol NSCopying -- (id)copyWithZone:(NSZone *)zone; -@end -@protocol NSMutableCopying - (id)mutableCopyWithZone:(NSZone *)zone; @end -@protocol NSCoding -- (void)encodeWithCoder:(NSCoder *)aCoder; -@end -@interface NSObject <NSObject> {} -- (id)init; -+ (id)allocWithZone:(NSZone *)zone; -@end -extern id NSAllocateObject(Class aClass, NSUInteger extraBytes, NSZone *zone); -@interface NSString : NSObject <NSCopying, NSMutableCopying, NSCoding> -- (NSUInteger)length; -+ (id)stringWithUTF8String:(const char *)nullTerminatedCString; -@end extern NSString * const NSBundleDidLoadNotification; -@interface NSValue : NSObject <NSCopying, NSCoding> -- (void)getValue:(void *)value; -@end -@interface NSNumber : NSValue -- (char)charValue; -- (id)initWithBool:(BOOL)value; -@end -@interface NSAssertionHandler : NSObject {} -+ (NSAssertionHandler *)currentHandler; -- (void)handleFailureInMethod:(SEL)selector object:(id)object file:(NSString *)fileName lineNumber:(NSInteger)line description:(NSString *)format,...; -@end -extern NSString * const NSConnectionReplyMode; -typedef float CGFloat; -typedef struct _NSPoint { - CGFloat x; - CGFloat y; -} NSPoint; -typedef struct _NSSize { - CGFloat width; - CGFloat height; -} NSSize; -typedef struct _NSRect { - NSPoint origin; - NSSize size; -} NSRect; - -// *** This case currently crashes for RegionStore *** -// Reduced from a crash involving the cast of an Objective-C symbolic region to -// 'char *' -static NSNumber *test_ivar_offset(id self, SEL _cmd, Ivar inIvar) { - return [[[NSNumber allocWithZone:((void*)0)] initWithBool:*(_Bool *)((char *)self + ivar_getOffset(inIvar))] autorelease]; -} diff --git a/clang/test/Analysis/misc-ps.m b/clang/test/Analysis/misc-ps.m index e49cdb0a962..1b16762c42e 100644 --- a/clang/test/Analysis/misc-ps.m +++ b/clang/test/Analysis/misc-ps.m @@ -3,22 +3,40 @@ // RUN: clang-cc -analyze -checker-cfref --analyzer-store=region -analyzer-constraints=basic --verify -fblocks %s && // RUN: clang-cc -analyze -checker-cfref --analyzer-store=region -analyzer-constraints=range --verify -fblocks %s +typedef struct objc_ivar *Ivar; typedef struct objc_selector *SEL; typedef signed char BOOL; typedef int NSInteger; typedef unsigned int NSUInteger; typedef struct _NSZone NSZone; @class NSInvocation, NSArray, NSMethodSignature, NSCoder, NSString, NSEnumerator; -@protocol NSObject - (BOOL)isEqual:(id)object; @end -@protocol NSCopying - (id)copyWithZone:(NSZone *)zone; @end +@protocol NSObject +- (BOOL)isEqual:(id)object; +- (id)autorelease; +@end +@protocol NSCopying +- (id)copyWithZone:(NSZone *)zone; +@end @protocol NSMutableCopying - (id)mutableCopyWithZone:(NSZone *)zone; @end -@protocol NSCoding - (void)encodeWithCoder:(NSCoder *)aCoder; @end -@interface NSObject <NSObject> {} - (id)init; @end +@protocol NSCoding +- (void)encodeWithCoder:(NSCoder *)aCoder; +@end +@interface NSObject <NSObject> {} +- (id)init; ++ (id)allocWithZone:(NSZone *)zone; +@end extern id NSAllocateObject(Class aClass, NSUInteger extraBytes, NSZone *zone); @interface NSString : NSObject <NSCopying, NSMutableCopying, NSCoding> - (NSUInteger)length; + (id)stringWithUTF8String:(const char *)nullTerminatedCString; @end extern NSString * const NSBundleDidLoadNotification; +@interface NSValue : NSObject <NSCopying, NSCoding> +- (void)getValue:(void *)value; +@end +@interface NSNumber : NSValue +- (char)charValue; +- (id)initWithBool:(BOOL)value; +@end @interface NSAssertionHandler : NSObject {} + (NSAssertionHandler *)currentHandler; - (void)handleFailureInMethod:(SEL)selector object:(id)object file:(NSString *)fileName lineNumber:(NSInteger)line description:(NSString *)format,...; @@ -468,3 +486,8 @@ void test_invalidate_cast_int() { return; } +// Reduced from a crash involving the cast of an Objective-C symbolic region to +// 'char *' +static NSNumber *test_ivar_offset(id self, SEL _cmd, Ivar inIvar) { + return [[[NSNumber allocWithZone:((void*)0)] initWithBool:*(_Bool *)((char *)self + ivar_getOffset(inIvar))] autorelease]; +} |