[cfe-commits] r73519 - /cfe/trunk/test/SemaObjC/undeclared-selector.m
Fariborz Jahanian
fjahanian at apple.com
Tue Jun 16 10:57:28 PDT 2009
Author: fjahanian
Date: Tue Jun 16 12:57:28 2009
New Revision: 73519
URL: http://llvm.org/viewvc/llvm-project?rev=73519&view=rev
Log:
Test case was left behind from my last patch.
Added:
cfe/trunk/test/SemaObjC/undeclared-selector.m
Added: cfe/trunk/test/SemaObjC/undeclared-selector.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/undeclared-selector.m?rev=73519&view=auto
==============================================================================
--- cfe/trunk/test/SemaObjC/undeclared-selector.m (added)
+++ cfe/trunk/test/SemaObjC/undeclared-selector.m Tue Jun 16 12:57:28 2009
@@ -0,0 +1,45 @@
+// RUN: clang-cc -fsyntax-only -Wundeclared-selector -verify %s
+
+typedef struct objc_selector *SEL;
+
+ at interface MyClass
+
++ (void) methodA;
+- (void) methodB;
++ (void) methodD;
+- (void) methodF;
+
+ at end
+
+ at implementation MyClass
+
++ (void) methodA {}
+- (void) methodB {}
++ (void) methodD
+{
+ SEL d = @selector(methodD); /* Ok */
+ SEL e = @selector(methodE); // expected-warning {{undeclared selector 'methodE'}}
+}
+
+- (void) methodE
+{
+ SEL e = @selector(methodE); /* Ok */
+}
+
+- (void) methodF
+{
+ SEL e = @selector(methodE); /* Ok */
+}
+
+ at end
+
+int main (void)
+{
+ SEL a = @selector(methodA); /* Ok */
+ SEL b = @selector(methodB); /* Ok */
+ SEL c = @selector(methodC); // expected-warning {{undeclared selector 'methodC'}}
+ SEL d = @selector(methodD); /* Ok */
+ SEL e = @selector(methodE); /* Ok */
+ return 0;
+
+}
More information about the cfe-commits
mailing list