summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Modules')
-rw-r--r--clang/test/Modules/Inputs/cxx-decls-imported.h5
-rw-r--r--clang/test/Modules/Inputs/dummy.h3
-rw-r--r--clang/test/Modules/Inputs/module.map4
-rw-r--r--clang/test/Modules/cxx-decls.cpp9
4 files changed, 21 insertions, 0 deletions
diff --git a/clang/test/Modules/Inputs/cxx-decls-imported.h b/clang/test/Modules/Inputs/cxx-decls-imported.h
index e69de29bb2d..b94368614df 100644
--- a/clang/test/Modules/Inputs/cxx-decls-imported.h
+++ b/clang/test/Modules/Inputs/cxx-decls-imported.h
@@ -0,0 +1,5 @@
+class HasFriends {
+ friend void friend_1(HasFriends);
+ friend void friend_2(HasFriends);
+ void private_thing();
+};
diff --git a/clang/test/Modules/Inputs/dummy.h b/clang/test/Modules/Inputs/dummy.h
new file mode 100644
index 00000000000..6e1ac74e44f
--- /dev/null
+++ b/clang/test/Modules/Inputs/dummy.h
@@ -0,0 +1,3 @@
+// This module only exists to make local decl IDs and global decl IDs different.
+
+struct Dummy {} extern *dummy1, *dummy2, *dummy3;
diff --git a/clang/test/Modules/Inputs/module.map b/clang/test/Modules/Inputs/module.map
index 7be8b797a1a..ac3543b6440 100644
--- a/clang/test/Modules/Inputs/module.map
+++ b/clang/test/Modules/Inputs/module.map
@@ -222,6 +222,10 @@ module diag_pragma {
header "diag_pragma.h"
}
+module dummy {
+ header "dummy.h"
+}
+
module builtin {
header "builtin.h"
explicit module sub {
diff --git a/clang/test/Modules/cxx-decls.cpp b/clang/test/Modules/cxx-decls.cpp
index 733e3f90bc7..ba3281aaec7 100644
--- a/clang/test/Modules/cxx-decls.cpp
+++ b/clang/test/Modules/cxx-decls.cpp
@@ -3,6 +3,7 @@
// expected-no-diagnostics
+@import dummy;
@import cxx_decls.imported;
void test_delete(int *p) {
@@ -10,3 +11,11 @@ void test_delete(int *p) {
// ever been explicitly declared in an unimported submodule.
delete p;
}
+
+void friend_1(HasFriends s) {
+ s.private_thing();
+}
+void test_friends(HasFriends s) {
+ friend_1(s);
+ friend_2(s);
+}
OpenPOWER on IntegriCloud