blob: 712e55d4d647e405ec580a81d3644bc7dfbf4dfb [file] [log] [blame]
Douglas Gregor0d266d62012-01-25 00:59:09 +00001// RUN: rm -rf %t
Douglas Gregor953a61f2013-02-07 19:01:24 +00002// RUN: %clang_cc1 -fmodules-cache-path=%t -fmodules -I %S/Inputs %s -verify
Douglas Gregor0d266d62012-01-25 00:59:09 +00003
Douglas Gregor1b257af2012-12-11 22:11:52 +00004@import MethodPoolA;
Douglas Gregor0d266d62012-01-25 00:59:09 +00005
6
7// in other file: // expected-note{{using}}
8
9
10
11
12// in other file: expected-note{{also found}}
13
14void testMethod1(id object) {
15 [object method1];
16}
17
18void testMethod2(id object) {
19 [object method2:1];
20}
21
Douglas Gregor7666b032013-02-07 19:13:24 +000022void testMethod4(id object) {
23 [object method4]; // expected-warning{{instance method '-method4' not found (return type defaults to 'id')}}
24}
25
Douglas Gregor1b257af2012-12-11 22:11:52 +000026@import MethodPoolB;
Douglas Gregor0d266d62012-01-25 00:59:09 +000027
28void testMethod1Again(id object) {
29 [object method1];
30}
31
32void testMethod2Again(id object) {
33 [object method2:1]; // expected-warning{{multiple methods named 'method2:' found}}
34}
Douglas Gregorf0e00042013-01-16 18:47:38 +000035
36void testMethod3(id object) {
37 [object method3]; // expected-warning{{instance method '-method3' not found (return type defaults to 'id')}}
38}
39
40@import MethodPoolB.Sub;
41
42void testMethod3Again(id object) {
43 char *str = [object method3]; // okay: only found in MethodPoolB.Sub
44}
45
46@import MethodPoolA.Sub;
47
48void testMethod3AgainAgain(id object) {
49 [object method3]; // expected-warning{{multiple methods named 'method3' found}}
50 // expected-note@2{{using}}
51 // expected-note@2{{also found}}
52}
Douglas Gregor7666b032013-02-07 19:13:24 +000053
54void testMethod4Again(id object) {
55 [object method4];
56}