aboutsummaryrefslogtreecommitdiff
path: root/test/SemaObjC/default-synthesize-3.m
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2013-12-22 00:07:40 +0000
committerDimitry Andric <dim@FreeBSD.org>2013-12-22 00:07:40 +0000
commitbfef399519ca9b8a4b4c6b563253bad7e0eeffe0 (patch)
treedf8df0b0067b381eab470a3b8f28d14a552a6340 /test/SemaObjC/default-synthesize-3.m
parent6a0372513edbc473b538d2f724efac50405d6fef (diff)
downloadsrc-bfef399519ca9b8a4b4c6b563253bad7e0eeffe0.tar.gz
src-bfef399519ca9b8a4b4c6b563253bad7e0eeffe0.zip
Vendor import of clang release_34 branch r197841 (effectively, 3.4 RC3):vendor/clang/clang-release_34-r197841
Notes
Notes: svn path=/vendor/clang/dist/; revision=259701 svn path=/vendor/clang/clang-release_34-r197841/; revision=259703; tag=vendor/clang/clang-release_34-r197841
Diffstat (limited to 'test/SemaObjC/default-synthesize-3.m')
-rw-r--r--test/SemaObjC/default-synthesize-3.m74
1 files changed, 72 insertions, 2 deletions
diff --git a/test/SemaObjC/default-synthesize-3.m b/test/SemaObjC/default-synthesize-3.m
index 82f968da0009..1c32665a2dd7 100644
--- a/test/SemaObjC/default-synthesize-3.m
+++ b/test/SemaObjC/default-synthesize-3.m
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -x objective-c -fsyntax-only -fobjc-default-synthesize-properties -verify -Wno-objc-root-class %s
-// RUN: %clang_cc1 -x objective-c++ -fsyntax-only -fobjc-default-synthesize-properties -verify -Wno-objc-root-class %s
+// RUN: %clang_cc1 -x objective-c -fsyntax-only -verify -Wno-objc-root-class %s
+// RUN: %clang_cc1 -x objective-c++ -fsyntax-only -verify -Wno-objc-root-class %s
#if __has_attribute(objc_requires_property_definitions)
__attribute ((objc_requires_property_definitions))
@@ -111,3 +111,73 @@ __attribute ((objc_requires_property_definitions)) // expected-error {{objc_requ
@implementation S
@end
+
+// rdar://14085456
+// No warning must be issued in this test.
+@interface ParentObject
+@end
+
+@protocol TestObject
+@property (readonly) int six;
+@end
+
+@interface TestObject : ParentObject <TestObject>
+@property int six;
+@end
+
+@implementation TestObject
+@synthesize six;
+@end
+
+// rdar://14094682
+// no warning in this test
+@interface ISAChallenge : NSObject {
+}
+
+@property (assign, readonly) int failureCount;
+@end
+
+@interface ISSAChallenge : ISAChallenge {
+ int _failureCount;
+}
+@property (assign, readwrite) int failureCount;
+@end
+
+@implementation ISAChallenge
+- (int)failureCount {
+ return 0;
+}
+@end
+
+@implementation ISSAChallenge
+
+@synthesize failureCount = _failureCount;
+@end
+
+__attribute ((objc_requires_property_definitions(1))) // expected-error {{'objc_requires_property_definitions' attribute takes no arguments}}
+@interface I1
+@end
+
+// rdar://15051465
+@protocol SubFooling
+ @property(nonatomic, readonly) id hoho; // expected-note 2 {{property declared here}}
+@end
+
+@protocol Fooing<SubFooling>
+ @property(nonatomic, readonly) id muahahaha; // expected-note 2 {{property declared here}}
+@end
+
+typedef NSObject<Fooing> FooObject;
+
+@interface Okay : NSObject<Fooing>
+@end
+
+@implementation Okay // expected-warning 2 {{auto property synthesis will not synthesize property declared in a protocol}}
+@end
+
+@interface Fail : FooObject
+@end
+
+@implementation Fail // expected-warning 2 {{auto property synthesis will not synthesize property declared in a protocol}}
+@end
+