summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Modules/Inputs/MethodPoolA.h8
-rw-r--r--clang/test/Modules/Inputs/MethodPoolB.h13
-rw-r--r--clang/test/Modules/Inputs/module.map6
-rw-r--r--clang/test/Modules/method_pool.m30
4 files changed, 57 insertions, 0 deletions
diff --git a/clang/test/Modules/Inputs/MethodPoolA.h b/clang/test/Modules/Inputs/MethodPoolA.h
new file mode 100644
index 00000000000..6af24a92911
--- /dev/null
+++ b/clang/test/Modules/Inputs/MethodPoolA.h
@@ -0,0 +1,8 @@
+
+
+
+
+@interface A
++ (int)method1;
+- (int)method2:(int)param;
+@end
diff --git a/clang/test/Modules/Inputs/MethodPoolB.h b/clang/test/Modules/Inputs/MethodPoolB.h
new file mode 100644
index 00000000000..e1e86edaf84
--- /dev/null
+++ b/clang/test/Modules/Inputs/MethodPoolB.h
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+@interface B
+- (int)method1;
+- (int)method2:(float)param;
+@end
diff --git a/clang/test/Modules/Inputs/module.map b/clang/test/Modules/Inputs/module.map
index 2819e62b8f1..e09073f818c 100644
--- a/clang/test/Modules/Inputs/module.map
+++ b/clang/test/Modules/Inputs/module.map
@@ -75,3 +75,9 @@ module namespaces_right {
header "namespaces-right.h"
export *
}
+module MethodPoolA {
+ header "MethodPoolA.h"
+}
+module MethodPoolB {
+ header "MethodPoolB.h"
+}
diff --git a/clang/test/Modules/method_pool.m b/clang/test/Modules/method_pool.m
new file mode 100644
index 00000000000..9574caa1528
--- /dev/null
+++ b/clang/test/Modules/method_pool.m
@@ -0,0 +1,30 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -fmodule-cache-path %t -fmodules -I %S/Inputs %s -verify
+
+@import MethodPoolA;
+
+
+// in other file: // expected-note{{using}}
+
+
+
+
+// in other file: expected-note{{also found}}
+
+void testMethod1(id object) {
+ [object method1];
+}
+
+void testMethod2(id object) {
+ [object method2:1];
+}
+
+@import MethodPoolB;
+
+void testMethod1Again(id object) {
+ [object method1];
+}
+
+void testMethod2Again(id object) {
+ [object method2:1]; // expected-warning{{multiple methods named 'method2:' found}}
+}
OpenPOWER on IntegriCloud