diff options
Diffstat (limited to 'test/Analysis/dynamic_type_check.m')
-rw-r--r-- | test/Analysis/dynamic_type_check.m | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/test/Analysis/dynamic_type_check.m b/test/Analysis/dynamic_type_check.m deleted file mode 100644 index 6753892e1d52..000000000000 --- a/test/Analysis/dynamic_type_check.m +++ /dev/null @@ -1,43 +0,0 @@ -// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core.DynamicTypeChecker -verify %s - - -#define nil 0 -typedef unsigned long NSUInteger; -typedef int BOOL; - -@protocol NSObject -+ (id)alloc; -- (id)init; -@end - -@protocol NSCopying -@end - -__attribute__((objc_root_class)) -@interface NSObject <NSObject> -@end - -@interface NSString : NSObject <NSCopying> -@end - -@interface NSMutableString : NSString -@end - -@interface NSNumber : NSObject <NSCopying> -@end - -@class MyType; - -void testTypeCheck(NSString* str) { - id obj = str; - NSNumber *num = obj; // expected-warning {{}} - (void)num; -} - -void testForwardDeclarations(NSString* str) { - id obj = str; - // Do not warn, since no information is available whether MyType is a sub or - // super class of any other type. - MyType *num = obj; // no warning - (void)num; -} |