diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2008-12-05 18:38:31 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2008-12-05 18:38:31 +0000 |
commit | a8ef2ecf08fbadd3901f583a559a73e4443fa882 (patch) | |
tree | 61600a384ad5945b2b1c68fce875c70f4ba00dd1 | |
parent | 8daab970b80ed2e751fc88327180acbeff1dbb9c (diff) |
Fixed a test case. Added a test case showing property setter's
type mismatch (related to my last patch).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60599 91177308-0d34-0410-b5e6-96231b3b80d8
-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 + |