llvm-project
50 строк · 1.2 Кб
1// RUN: %clang_cc1 -arcmt-action=check -fobjc-arc -fobjc-runtime=macosx-10.8.0 -triple x86_64-apple-darwin12 -fblocks -Werror %s
2
3#if __has_feature(objc_arc)
4#define NS_AUTOMATED_REFCOUNT_UNAVAILABLE __attribute__((unavailable("not available in automatic reference counting mode")))
5#else
6#define NS_AUTOMATED_REFCOUNT_UNAVAILABLE
7#endif
8
9typedef const void * CFTypeRef;
10CFTypeRef CFBridgingRetain(id X);
11id CFBridgingRelease(CFTypeRef);
12
13typedef int BOOL;
14typedef unsigned NSUInteger;
15
16@protocol NSObject
17- (id)retain NS_AUTOMATED_REFCOUNT_UNAVAILABLE;
18- (NSUInteger)retainCount NS_AUTOMATED_REFCOUNT_UNAVAILABLE;
19- (oneway void)release NS_AUTOMATED_REFCOUNT_UNAVAILABLE;
20- (id)autorelease NS_AUTOMATED_REFCOUNT_UNAVAILABLE;
21@end
22
23@interface NSObject <NSObject> {}
24- (id)init;
25
26+ (id)new;
27+ (id)alloc;
28- (void)dealloc;
29
30- (void)finalize;
31
32- (id)copy;
33- (id)mutableCopy;
34@end
35
36typedef const struct __CFString * CFStringRef;
37extern const CFStringRef kUTTypePlainText;
38extern const CFStringRef kUTTypeRTF;
39@class NSString;
40
41@interface Test : NSObject
42@property (weak) NSString *weakProperty;
43@end
44
45@implementation Test
46@end
47
48#if ! __has_feature(objc_arc)
49#error This file must be compiled with ARC (set -fobjc_arc flag on file)
50#endif
51