aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2010-07-23 20:32:57 +0000
committerFariborz Jahanian <fjahanian@apple.com>2010-07-23 20:32:57 +0000
commitcad910db92a4f22d6a575d9e7d7250df480ede12 (patch)
tree22abd0f167218d608ab316195ee833f7885a86c8
parent0fab8cd9bd9093ce16b6ce64a152d861ba408652 (diff)
Test for selector-warning PCH patch.
radar 6507158. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109261 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/PCH/selector-warning.h24
-rw-r--r--test/PCH/selector-warning.m19
2 files changed, 43 insertions, 0 deletions
diff --git a/test/PCH/selector-warning.h b/test/PCH/selector-warning.h
new file mode 100644
index 0000000000..bd419293da
--- /dev/null
+++ b/test/PCH/selector-warning.h
@@ -0,0 +1,24 @@
+typedef struct objc_selector *SEL;
+
+@interface Foo
+- (void) NotOK;
+@end
+
+@implementation Foo
+- (void) foo
+{
+ SEL a = @selector(b1ar);
+ a = @selector(b1ar);
+ a = @selector(bar);
+ a = @selector(ok); // expected-warning {{unimplemented selector 'ok'}}
+ a = @selector(ok);
+ a = @selector(NotOK); // expected-warning {{unimplemented selector 'NotOK'}}
+ a = @selector(NotOK);
+
+ a = @selector(clNotOk); // expected-warning {{unimplemented selector 'clNotOk'}}
+
+ a = @selector (cl1);
+ a = @selector (cl2);
+ a = @selector (instNotOk); // expected-warning {{unimplemented selector 'instNotOk'}}
+}
+@end
diff --git a/test/PCH/selector-warning.m b/test/PCH/selector-warning.m
new file mode 100644
index 0000000000..413f64f541
--- /dev/null
+++ b/test/PCH/selector-warning.m
@@ -0,0 +1,19 @@
+// RUN: %clang_cc1 -x objective-c -emit-pch -o %t.h.pch %S/selector-warning.h
+// RUN: %clang_cc1 -include-pch %t.h.pch %s
+
+@interface Bar
++ (void) clNotOk;
+- (void) instNotOk;
++ (void) cl1;
+@end
+
+@implementation Bar
+- (void) bar {}
++ (void) cl1 {}
++ (void) cl2 {}
+@end
+
+@implementation Bar(CAT)
+- (void) b1ar {}
+@end
+