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