xref: /minix3/external/bsd/llvm/dist/clang/test/PCH/chain-selectors.m (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1f4a2713aSLionel Sambuc// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s -Wselector -include %S/Inputs/chain-selectors1.h -include %S/Inputs/chain-selectors2.h
2f4a2713aSLionel Sambuc
3f4a2713aSLionel Sambuc// RUN: %clang_cc1 -x objective-c -Wno-objc-root-class -emit-pch -o %t1 %S/Inputs/chain-selectors1.h
4f4a2713aSLionel Sambuc// RUN: %clang_cc1 -x objective-c -Wno-objc-root-class -emit-pch -o %t2 %S/Inputs/chain-selectors2.h -include-pch %t1
5f4a2713aSLionel Sambuc// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s -Wselector -include-pch %t2
6f4a2713aSLionel Sambuc
7f4a2713aSLionel Sambuc@implementation X
8f4a2713aSLionel Sambuc-(void)f {}
9f4a2713aSLionel Sambuc-(void)f2 {}
10f4a2713aSLionel Sambuc-(void)g: (int)p {}
11f4a2713aSLionel Sambuc-(void)h: (int)p1 foo: (int)p2 {}
12f4a2713aSLionel Sambuc@end
13f4a2713aSLionel Sambuc
14f4a2713aSLionel Sambucvoid bar() {
15f4a2713aSLionel Sambuc  id a = 0;
16f4a2713aSLionel Sambuc  [a nothing]; // expected-warning {{method '-nothing' not found}}
17f4a2713aSLionel Sambuc  [a f];
18f4a2713aSLionel Sambuc  // FIXME: Can't verify notes in headers
19f4a2713aSLionel Sambuc  //[a f2];
20f4a2713aSLionel Sambuc
21*0a6a1f1dSLionel Sambuc  (void)@selector(x); // expected-warning {{no method with selector 'x' is implemented in this translation unit}}
22*0a6a1f1dSLionel Sambuc  (void)@selector(y); // expected-warning {{no method with selector 'y' is implemented in this translation unit}}
23*0a6a1f1dSLionel Sambuc  (void)@selector(e); // expected-warning {{no method with selector 'e' is implemented in this translation unit}}
24f4a2713aSLionel Sambuc}
25f4a2713aSLionel Sambuc
26f4a2713aSLionel Sambuc@implementation X (Blah)
27f4a2713aSLionel Sambuc- (void)test_Blah {
28f4a2713aSLionel Sambuc  [self blah_method];
29f4a2713aSLionel Sambuc}
30f4a2713aSLionel Sambuc
31f4a2713aSLionel Sambuc- (void)blah_method { }
32f4a2713aSLionel Sambuc@end
33f4a2713aSLionel Sambuc
34f4a2713aSLionel Sambuc@implementation X (Blarg)
35f4a2713aSLionel Sambuc- (void)test_Blarg {
36f4a2713aSLionel Sambuc  [self blarg_method];
37f4a2713aSLionel Sambuc}
38f4a2713aSLionel Sambuc
39f4a2713aSLionel Sambuc- (void)blarg_method { }
40f4a2713aSLionel Sambuc@end
41