summaryrefslogtreecommitdiffstats
path: root/test/ARCMT/checking-in-arc.m
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-07-19 18:57:15 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-07-19 18:57:15 +0000
commitd0c5b8a8cb88dc9f323c1e4cccd9ba794d2263ad (patch)
tree04ab37543b9acdf6779aa3944abc62adcc8d90b4 /test/ARCMT/checking-in-arc.m
parentfe6dec6efaf860ed3eb20ee13267f35129f7747a (diff)
[arcmt] After checking is successful disable auto-synthesize to avoid "@synthesize of 'weak' property is only
allowed in ARC" errors. rdar://14461559 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186709 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/ARCMT/checking-in-arc.m')
-rw-r--r--test/ARCMT/checking-in-arc.m47
1 files changed, 47 insertions, 0 deletions
diff --git a/test/ARCMT/checking-in-arc.m b/test/ARCMT/checking-in-arc.m
new file mode 100644
index 0000000000..5a1b3d3f06
--- /dev/null
+++ b/test/ARCMT/checking-in-arc.m
@@ -0,0 +1,47 @@
+// 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
+// DISABLE: mingw32
+
+#if __has_feature(objc_arc)
+#define NS_AUTOMATED_REFCOUNT_UNAVAILABLE __attribute__((unavailable("not available in automatic reference counting mode")))
+#else
+#define NS_AUTOMATED_REFCOUNT_UNAVAILABLE
+#endif
+
+typedef const void * CFTypeRef;
+CFTypeRef CFBridgingRetain(id X);
+id CFBridgingRelease(CFTypeRef);
+
+typedef int BOOL;
+typedef unsigned NSUInteger;
+
+@protocol NSObject
+- (id)retain NS_AUTOMATED_REFCOUNT_UNAVAILABLE;
+- (NSUInteger)retainCount NS_AUTOMATED_REFCOUNT_UNAVAILABLE;
+- (oneway void)release NS_AUTOMATED_REFCOUNT_UNAVAILABLE;
+- (id)autorelease NS_AUTOMATED_REFCOUNT_UNAVAILABLE;
+@end
+
+@interface NSObject <NSObject> {}
+- (id)init;
+
++ (id)new;
++ (id)alloc;
+- (void)dealloc;
+
+- (void)finalize;
+
+- (id)copy;
+- (id)mutableCopy;
+@end
+
+typedef const struct __CFString * CFStringRef;
+extern const CFStringRef kUTTypePlainText;
+extern const CFStringRef kUTTypeRTF;
+@class NSString;
+
+@interface Test : NSObject
+@property (weak) NSString *weakProperty;
+@end
+
+@implementation Test
+@end