summaryrefslogtreecommitdiffstats
path: root/test/Modules/namespaces.cpp
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2013-04-08 18:45:10 +0000
committerdim <dim@FreeBSD.org>2013-04-08 18:45:10 +0000
commitc72c57c9e9b69944e3e009cd5e209634839581d3 (patch)
tree4fc2f184c499d106f29a386c452b49e5197bf63d /test/Modules/namespaces.cpp
parent5b20025c30d23d521e12c1f33ec8fa6b821952cd (diff)
downloadFreeBSD-src-c72c57c9e9b69944e3e009cd5e209634839581d3.zip
FreeBSD-src-c72c57c9e9b69944e3e009cd5e209634839581d3.tar.gz
Vendor import of clang trunk r178860:
http://llvm.org/svn/llvm-project/cfe/trunk@178860
Diffstat (limited to 'test/Modules/namespaces.cpp')
-rw-r--r--test/Modules/namespaces.cpp31
1 files changed, 22 insertions, 9 deletions
diff --git a/test/Modules/namespaces.cpp b/test/Modules/namespaces.cpp
index 19e0c5a..0e9dbff 100644
--- a/test/Modules/namespaces.cpp
+++ b/test/Modules/namespaces.cpp
@@ -1,9 +1,8 @@
// RUN: rm -rf %t
-// RUN: %clang_cc1 -x objective-c++ -fmodules -fmodule-cache-path %t -I %S/Inputs %s -verify
+// RUN: %clang_cc1 -x objective-c++ -fmodules -fmodules-cache-path=%t -I %S/Inputs %s -verify
-// Importing modules which add declarations to a pre-existing non-imported
-// overload set does not currently work.
-// XFAIL: *
+int &global(int);
+int &global2(int);
namespace N6 {
char &f(char);
@@ -11,17 +10,32 @@ namespace N6 {
namespace N8 { }
-@__experimental_modules_import namespaces_left;
-@__experimental_modules_import namespaces_right;
+namespace LookupBeforeImport {
+ int &f(int);
+}
+void testEarly() {
+ int &r = LookupBeforeImport::f(1);
+}
+
+@import namespaces_left;
+@import namespaces_right;
void test() {
int &ir1 = N1::f(1);
int &ir2 = N2::f(1);
int &ir3 = N3::f(1);
+ int &ir4 = global(1);
+ int &ir5 = ::global2(1);
float &fr1 = N1::f(1.0f);
float &fr2 = N2::f(1.0f);
+ float &fr3 = global(1.0f);
+ float &fr4 = ::global2(1.0f);
+ float &fr5 = LookupBeforeImport::f(1.0f);
double &dr1 = N2::f(1.0);
double &dr2 = N3::f(1.0);
+ double &dr3 = global(1.0);
+ double &dr4 = ::global2(1.0);
+ double &dr5 = LookupBeforeImport::f(1.0);
}
// Test namespaces merged without a common first declaration.
@@ -54,11 +68,10 @@ void testMergedMerged() {
// Test merging when using anonymous namespaces, which does not
// actually perform any merging.
-// other file: expected-note{{passing argument to parameter here}}
void testAnonymousNotMerged() {
N11::consumeFoo(N11::getFoo()); // expected-error{{cannot initialize a parameter of type 'N11::<anonymous>::Foo *' with an rvalue of type 'N11::<anonymous>::Foo *'}}
N12::consumeFoo(N12::getFoo()); // expected-error{{cannot initialize a parameter of type 'N12::<anonymous>::Foo *' with an rvalue of type 'N12::<anonymous>::Foo *'}}
}
-
-// other file: expected-note{{passing argument to parameter here}}
+// namespaces-right.h: expected-note@60 {{passing argument to parameter here}}
+// namespaces-right.h: expected-note@67 {{passing argument to parameter here}}
OpenPOWER on IntegriCloud