summaryrefslogtreecommitdiffstats
path: root/test/SemaObjC/default-synthesize.m
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaObjC/default-synthesize.m')
-rw-r--r--test/SemaObjC/default-synthesize.m33
1 files changed, 28 insertions, 5 deletions
diff --git a/test/SemaObjC/default-synthesize.m b/test/SemaObjC/default-synthesize.m
index 0d2f473..e6ea0a5 100644
--- a/test/SemaObjC/default-synthesize.m
+++ b/test/SemaObjC/default-synthesize.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -fobjc-default-synthesize-properties -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fobjc-default-synthesize-properties -verify -Wno-objc-root-class %s
@interface NSString @end
@@ -10,7 +10,9 @@
@end
@implementation SynthItAll
-//@synthesize howMany, what;
+#if !__has_feature(objc_default_synthesize_properties)
+@synthesize howMany, what;
+#endif
@end
@@ -20,7 +22,9 @@
@end
@implementation SynthSetter
-//@synthesize howMany, what;
+#if !__has_feature(objc_default_synthesize_properties)
+@synthesize howMany, what;
+#endif
- (int) howMany {
return self.howMany;
@@ -40,7 +44,9 @@
@end
@implementation SynthGetter
-//@synthesize howMany, what;
+#if !__has_feature(objc_default_synthesize_properties)
+@synthesize howMany, what;
+#endif
// - (int) howMany
- (void) setHowMany: (int) value {
@@ -61,7 +67,9 @@
@end
@implementation SynthNone
-//@synthesize howMany, what; // REM: Redundant anyway
+#if !__has_feature(objc_default_synthesize_properties)
+@synthesize howMany, what; // REM: Redundant anyway
+#endif
- (int) howMany {
return self.howMany;
@@ -112,6 +120,21 @@
@implementation D
- (int) Meth { return self.PROP; }
+#if __has_feature(objc_default_synthesize_properties)
@synthesize PROP=IVAR;
+#endif
@end
+// rdar://10567333
+@protocol MyProtocol
+@property (nonatomic, strong) NSString *requiredString; // expected-note {{property declared here}}
+
+@optional
+@property (nonatomic, strong) NSString *optionalString;
+@end
+
+@interface MyClass <MyProtocol>
+@end
+
+@implementation MyClass // expected-warning {{auto property synthesis will not synthesize property declared in a protocol}}
+@end
OpenPOWER on IntegriCloud