blob: 1d76a8404c6b1483887c6165560c4529e2c32620 [file] [log] [blame]
Douglas Gregor70f449b2012-01-25 00:59:09 +00001// RUN: rm -rf %t
Richard Smith47972af2015-06-16 00:08:24 +00002// RUN: %clang_cc1 -fmodules-cache-path=%t -fmodules -fimplicit-module-maps -I %S/Inputs %s -verify
Douglas Gregor70f449b2012-01-25 00:59:09 +00003
Douglas Gregorc1489562013-02-12 23:36:21 +00004
Douglas Gregorc50d4922012-12-11 22:11:52 +00005@import MethodPoolA;
Douglas Gregor70f449b2012-01-25 00:59:09 +00006
Douglas Gregorc1489562013-02-12 23:36:21 +00007@interface D
8- (void)method5:(D*)obj;
9@end
Douglas Gregor70f449b2012-01-25 00:59:09 +000010
Andy Gibbsfcc699a2013-04-17 08:06:46 +000011// expected-note@Inputs/MethodPoolA.h:7{{using}}
12// expected-note@Inputs/MethodPoolB.h:12{{also found}}
Douglas Gregor70f449b2012-01-25 00:59:09 +000013
14void testMethod1(id object) {
15 [object method1];
16}
17
18void testMethod2(id object) {
19 [object method2:1];
20}
21
Douglas Gregor560b7fa2013-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 Gregorc1489562013-02-12 23:36:21 +000026void testMethod5(id object, D* d) {
27 [object method5:d];
28}
29
Douglas Gregorc50d4922012-12-11 22:11:52 +000030@import MethodPoolB;
Douglas Gregor70f449b2012-01-25 00:59:09 +000031
32void testMethod1Again(id object) {
33 [object method1];
34}
35
36void testMethod2Again(id object) {
37 [object method2:1]; // expected-warning{{multiple methods named 'method2:' found}}
38}
Douglas Gregor77f49a42013-01-16 18:47:38 +000039
40void testMethod3(id object) {
41 [object method3]; // expected-warning{{instance method '-method3' not found (return type defaults to 'id')}}
42}
43
44@import MethodPoolB.Sub;
45
46void testMethod3Again(id object) {
47 char *str = [object method3]; // okay: only found in MethodPoolB.Sub
48}
49
Douglas Gregor600a2f52013-06-21 00:20:25 +000050void testMethod6(id object) {
51 [object method6];
52}
53
Douglas Gregor77f49a42013-01-16 18:47:38 +000054@import MethodPoolA.Sub;
55
56void testMethod3AgainAgain(id object) {
57 [object method3]; // expected-warning{{multiple methods named 'method3' found}}
Andy Gibbsfcc699a2013-04-17 08:06:46 +000058 // expected-note@Inputs/MethodPoolBSub.h:2{{using}}
59 // expected-note@Inputs/MethodPoolASub.h:2{{also found}}
Douglas Gregor77f49a42013-01-16 18:47:38 +000060}
Douglas Gregor560b7fa2013-02-07 19:13:24 +000061
62void testMethod4Again(id object) {
63 [object method4];
64}
Douglas Gregorc1489562013-02-12 23:36:21 +000065
66void testMethod5Again(id object, D* d) {
67 [object method5:d];
68}