[cfe-commits] r60599 - in /cfe/trunk/test/SemaObjC: method-typecheck-1.m property-typecheck-1.m

Fariborz Jahanian fjahanian at apple.com
Fri Dec 5 10:38:32 PST 2008


Author: fjahanian
Date: Fri Dec  5 12:38:31 2008
New Revision: 60599

URL: http://llvm.org/viewvc/llvm-project?rev=60599&view=rev
Log:
Fixed a test case. Added a test case showing property setter's
type mismatch (related to my last patch).

Added:
    cfe/trunk/test/SemaObjC/property-typecheck-1.m
Modified:
    cfe/trunk/test/SemaObjC/method-typecheck-1.m

Modified: cfe/trunk/test/SemaObjC/method-typecheck-1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/method-typecheck-1.m?rev=60599&r1=60598&r2=60599&view=diff

==============================================================================
--- cfe/trunk/test/SemaObjC/method-typecheck-1.m (original)
+++ cfe/trunk/test/SemaObjC/method-typecheck-1.m Fri Dec  5 12:38:31 2008
@@ -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}}

Added: cfe/trunk/test/SemaObjC/property-typecheck-1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/property-typecheck-1.m?rev=60599&view=auto

==============================================================================
--- cfe/trunk/test/SemaObjC/property-typecheck-1.m (added)
+++ cfe/trunk/test/SemaObjC/property-typecheck-1.m Fri Dec  5 12:38:31 2008
@@ -0,0 +1,19 @@
+// RUN: clang -fsyntax-only -verify %s
+
+ at interface A
+-(float) x;
+ at property int x; // expected-error {{type of property 'x' does not match type of accessor 'x'}}
+ at end
+
+ at interface A (Cat)
+ at property int moo;	// expected-note {{previous definition is here}}
+ at end
+
+ at implementation A (Cat)
+-(int) moo {
+  return 0;
+}
+-(void) setMoo: (float) x { // expected-warning {{conflicting types for 'setMoo:'}}
+}
+ at end
+





More information about the cfe-commits mailing list