blob: 1ba5abd13902056ae0623e73edc0a6af26fcf94a [file] [log] [blame]
Douglas Gregor0d266d62012-01-25 00:59:09 +00001// RUN: rm -rf %t
2// RUN: %clang_cc1 -fmodule-cache-path %t -fmodules -I %S/Inputs %s -verify
3
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 Gregor1b257af2012-12-11 22:11:52 +000022@import MethodPoolB;
Douglas Gregor0d266d62012-01-25 00:59:09 +000023
24void testMethod1Again(id object) {
25 [object method1];
26}
27
28void testMethod2Again(id object) {
29 [object method2:1]; // expected-warning{{multiple methods named 'method2:' found}}
30}
Douglas Gregorf0e00042013-01-16 18:47:38 +000031
32void testMethod3(id object) {
33 [object method3]; // expected-warning{{instance method '-method3' not found (return type defaults to 'id')}}
34}
35
36@import MethodPoolB.Sub;
37
38void testMethod3Again(id object) {
39 char *str = [object method3]; // okay: only found in MethodPoolB.Sub
40}
41
42@import MethodPoolA.Sub;
43
44void testMethod3AgainAgain(id object) {
45 [object method3]; // expected-warning{{multiple methods named 'method3' found}}
46 // expected-note@2{{using}}
47 // expected-note@2{{also found}}
48}