summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules/Inputs/cxx-lookup
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2014-08-13 01:23:33 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2014-08-13 01:23:33 +0000
commitbb853c79c0d61acaa0dd9aa4f77cded334166946 (patch)
tree03f13744f52312d2161759fb54b25fbe8219e3ae /clang/test/Modules/Inputs/cxx-lookup
parent46ef7ce2833f2efffc009d3a657c2c4f8f3569ea (diff)
downloadbcm5719-llvm-bb853c79c0d61acaa0dd9aa4f77cded334166946.tar.gz
bcm5719-llvm-bb853c79c0d61acaa0dd9aa4f77cded334166946.zip
[modules] When performing a lookup into a namespace, ensure that any later
redefinitions of that namespace have already been loaded. When writing out the names in a namespace, if we see a name that is locally declared and had imported declarations merged on top of it, export the local declaration as the lookup result, because it will be the most recent declaration of that entity in the redeclaration chain of an importer of the module. llvm-svn: 215518
Diffstat (limited to 'clang/test/Modules/Inputs/cxx-lookup')
-rw-r--r--clang/test/Modules/Inputs/cxx-lookup/a.h2
-rw-r--r--clang/test/Modules/Inputs/cxx-lookup/b.h3
-rw-r--r--clang/test/Modules/Inputs/cxx-lookup/c1.h3
-rw-r--r--clang/test/Modules/Inputs/cxx-lookup/c2.h2
-rw-r--r--clang/test/Modules/Inputs/cxx-lookup/module.modulemap8
-rw-r--r--clang/test/Modules/Inputs/cxx-lookup/x.h2
-rw-r--r--clang/test/Modules/Inputs/cxx-lookup/y.h5
7 files changed, 25 insertions, 0 deletions
diff --git a/clang/test/Modules/Inputs/cxx-lookup/a.h b/clang/test/Modules/Inputs/cxx-lookup/a.h
new file mode 100644
index 00000000000..25f614fe50b
--- /dev/null
+++ b/clang/test/Modules/Inputs/cxx-lookup/a.h
@@ -0,0 +1,2 @@
+// a
+namespace llvm { class GlobalValue; }
diff --git a/clang/test/Modules/Inputs/cxx-lookup/b.h b/clang/test/Modules/Inputs/cxx-lookup/b.h
new file mode 100644
index 00000000000..c2ede9f28dc
--- /dev/null
+++ b/clang/test/Modules/Inputs/cxx-lookup/b.h
@@ -0,0 +1,3 @@
+// b
+namespace llvm { class GlobalValue; }
+#include "y.h"
diff --git a/clang/test/Modules/Inputs/cxx-lookup/c1.h b/clang/test/Modules/Inputs/cxx-lookup/c1.h
new file mode 100644
index 00000000000..dba4a4c0a00
--- /dev/null
+++ b/clang/test/Modules/Inputs/cxx-lookup/c1.h
@@ -0,0 +1,3 @@
+// c1
+#include "a.h"
+#include "b.h"
diff --git a/clang/test/Modules/Inputs/cxx-lookup/c2.h b/clang/test/Modules/Inputs/cxx-lookup/c2.h
new file mode 100644
index 00000000000..463e270e267
--- /dev/null
+++ b/clang/test/Modules/Inputs/cxx-lookup/c2.h
@@ -0,0 +1,2 @@
+// c2
+namespace llvm { class GlobalValue; }
diff --git a/clang/test/Modules/Inputs/cxx-lookup/module.modulemap b/clang/test/Modules/Inputs/cxx-lookup/module.modulemap
new file mode 100644
index 00000000000..6d397af250c
--- /dev/null
+++ b/clang/test/Modules/Inputs/cxx-lookup/module.modulemap
@@ -0,0 +1,8 @@
+module A { header "a.h" export * }
+module B { header "b.h" export * }
+module C {
+ module C2 { header "c2.h" export * }
+ module C1 { header "c1.h" export * }
+}
+module X { header "x.h" export * }
+module Y { header "y.h" export * }
diff --git a/clang/test/Modules/Inputs/cxx-lookup/x.h b/clang/test/Modules/Inputs/cxx-lookup/x.h
new file mode 100644
index 00000000000..a8826e00581
--- /dev/null
+++ b/clang/test/Modules/Inputs/cxx-lookup/x.h
@@ -0,0 +1,2 @@
+template <class T> class allocator;
+struct X { virtual allocator<char> f(); };
diff --git a/clang/test/Modules/Inputs/cxx-lookup/y.h b/clang/test/Modules/Inputs/cxx-lookup/y.h
new file mode 100644
index 00000000000..8867e8a8bec
--- /dev/null
+++ b/clang/test/Modules/Inputs/cxx-lookup/y.h
@@ -0,0 +1,5 @@
+#include "x.h"
+namespace llvm {
+ struct ulittle32_t;
+ extern allocator<ulittle32_t> *x;
+}
OpenPOWER on IntegriCloud