blob: f2bfc4b9d3dfca80de9d87f625e366dae369102a [file] [log] [blame]
Patrick Beardb2f68202012-04-06 18:12:22 +00001// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s -Wselector -include %S/Inputs/chain-selectors1.h -include %S/Inputs/chain-selectors2.h
Sebastian Redla68340f2010-08-04 22:21:29 +00002
Patrick Beardb2f68202012-04-06 18:12:22 +00003// RUN: %clang_cc1 -x objective-c -Wno-objc-root-class -emit-pch -o %t1 %S/Inputs/chain-selectors1.h
4// RUN: %clang_cc1 -x objective-c -Wno-objc-root-class -emit-pch -o %t2 %S/Inputs/chain-selectors2.h -include-pch %t1
5// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s -Wselector -include-pch %t2
Sebastian Redla68340f2010-08-04 22:21:29 +00006
7@implementation X
8-(void)f {}
9-(void)f2 {}
10-(void)g: (int)p {}
11-(void)h: (int)p1 foo: (int)p2 {}
12@end
13
14void bar() {
15 id a = 0;
16 [a nothing]; // expected-warning {{method '-nothing' not found}}
17 [a f];
18 // FIXME: Can't verify notes in headers
19 //[a f2];
20
Fariborz Jahanian37bccca2013-05-28 23:49:32 +000021 (void)@selector(x); // expected-warning {{creating selector for nonexistent method 'x'}}
22 (void)@selector(y); // expected-warning {{creating selector for nonexistent method 'y'}}
23 (void)@selector(e); // expected-warning {{creating selector for nonexistent method 'e'}}
Sebastian Redla68340f2010-08-04 22:21:29 +000024}
Douglas Gregor5e9888c2010-10-02 21:06:43 +000025
26@implementation X (Blah)
27- (void)test_Blah {
28 [self blah_method];
29}
30
31- (void)blah_method { }
32@end
33
34@implementation X (Blarg)
35- (void)test_Blarg {
36 [self blarg_method];
37}
38
39- (void)blarg_method { }
40@end