Test case was left behind from my last patch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73519 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaObjC/undeclared-selector.m b/test/SemaObjC/undeclared-selector.m
new file mode 100644
index 0000000..354c316
--- /dev/null
+++ b/test/SemaObjC/undeclared-selector.m
@@ -0,0 +1,45 @@
+// RUN: clang-cc -fsyntax-only -Wundeclared-selector -verify %s
+
+typedef struct objc_selector *SEL;
+
+@interface MyClass
+
++ (void) methodA;
+- (void) methodB;
++ (void) methodD;
+- (void) methodF;
+
+@end
+
+@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 */
+}
+
+@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;
+
+}