diff options
-rw-r--r-- | test/SemaObjC/method-typecheck-1.m | 2 | ||||
-rw-r--r-- | test/SemaObjC/property-typecheck-1.m | 19 |
2 files changed, 21 insertions, 0 deletions
diff --git a/test/SemaObjC/method-typecheck-1.m b/test/SemaObjC/method-typecheck-1.m index 3b1b0c95a6..391f25e4d8 100644 --- a/test/SemaObjC/method-typecheck-1.m +++ b/test/SemaObjC/method-typecheck-1.m @@ -1,3 +1,5 @@ +// RUN: clang -fsyntax-only -verify %s + @interface A - (void) setMoo: (int) x; // expected-note {{previous definition is here}} - (int) setMoo1: (int) x; // expected-note {{previous definition is here}} diff --git a/test/SemaObjC/property-typecheck-1.m b/test/SemaObjC/property-typecheck-1.m new file mode 100644 index 0000000000..c02cbe03b8 --- /dev/null +++ b/test/SemaObjC/property-typecheck-1.m @@ -0,0 +1,19 @@ +// RUN: clang -fsyntax-only -verify %s + +@interface A +-(float) x; +@property int x; // expected-error {{type of property 'x' does not match type of accessor 'x'}} +@end + +@interface A (Cat) +@property int moo; // expected-note {{previous definition is here}} +@end + +@implementation A (Cat) +-(int) moo { + return 0; +} +-(void) setMoo: (float) x { // expected-warning {{conflicting types for 'setMoo:'}} +} +@end + |