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