From: Fariborz Jahanian Date: Fri, 23 Jul 2010 20:32:57 +0000 (+0000) Subject: Test for selector-warning PCH patch. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cad910db92a4f22d6a575d9e7d7250df480ede12;p=clang 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 --- 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 +