aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2012-01-03 19:46:00 +0000
committerFariborz Jahanian <fjahanian@apple.com>2012-01-03 19:46:00 +0000
commiteb4f2c56c298071d58b441ccf801b039be93788a (patch)
treee63957f215b5e1c4b3b0953a3af29e0cd75f1dd7 /test
parentc13a34b690d2dc2a03c2fea75a0a1438636c19ce (diff)
objc: use objc_suppress_autosynthesis attribute on classes
which should not be default synthesized. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147468 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/SemaObjC/default-synthesize-3.m33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/SemaObjC/default-synthesize-3.m b/test/SemaObjC/default-synthesize-3.m
new file mode 100644
index 0000000000..7b07cb9aa1
--- /dev/null
+++ b/test/SemaObjC/default-synthesize-3.m
@@ -0,0 +1,33 @@
+// RUN: %clang_cc1 -x objective-c -fsyntax-only -fobjc-default-synthesize-properties -verify %s
+// RUN: %clang_cc1 -x objective-c++ -fsyntax-only -fobjc-default-synthesize-properties -verify %s
+
+__attribute ((objc_suppress_autosynthesis))
+@interface NoAuto
+@property int NoAutoProp; // expected-note 2 {{property declared here}}
+@end
+
+@implementation NoAuto // expected-warning {{property 'NoAutoProp' requires method 'NoAutoProp' to be defined}} \
+ // expected-warning {{property 'NoAutoProp' requires method 'setNoAutoProp:'}}
+@end
+
+__attribute ((objc_suppress_autosynthesis)) // redundant, just for testing
+@interface Sub : NoAuto
+@property (copy) id SubProperty; // expected-note 2 {{property declared here}}
+@end
+
+@implementation Sub // expected-warning {{property 'SubProperty' requires method 'SubProperty' to be defined}} \
+ // expected-warning {{property 'SubProperty' requires method 'setSubProperty:' to be defined}}
+@end
+
+@interface Deep : Sub
+@property (copy) id DeepProperty;
+@property (copy) id DeepSynthProperty;
+@property (copy) id DeepMustSynthProperty; // expected-note {{property declared here}}
+@end
+
+@implementation Deep // expected-warning {{property 'DeepMustSynthProperty' requires method 'setDeepMustSynthProperty:' to be defined}}
+@dynamic DeepProperty;
+@synthesize DeepSynthProperty;
+- (id) DeepMustSynthProperty { return 0; }
+@end
+