aboutsummaryrefslogtreecommitdiff
path: root/test/Modules
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-04-05 00:52:14 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-04-05 00:52:14 +0000
commit5a15b9dc8386766592eec833dce1839ca7f56dbf (patch)
tree70bd705ba97af9b5d41b8370dd343901f7ae9c50 /test/Modules
parent6e22712b73ce5f0361355c9f2d0fa81b56722cd8 (diff)
Add a module testcase with a using declaration.
Thanks a lot to Richard Smith for the suggestion. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178825 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Modules')
-rw-r--r--test/Modules/Inputs/linkage-merge-bar.h3
-rw-r--r--test/Modules/Inputs/linkage-merge-foo.h1
-rw-r--r--test/Modules/linkage-merge.cpp10
3 files changed, 12 insertions, 2 deletions
diff --git a/test/Modules/Inputs/linkage-merge-bar.h b/test/Modules/Inputs/linkage-merge-bar.h
index e69de29bb2..cc528f7752 100644
--- a/test/Modules/Inputs/linkage-merge-bar.h
+++ b/test/Modules/Inputs/linkage-merge-bar.h
@@ -0,0 +1,3 @@
+#include <linkage-merge-foo.h>
+
+using ::g;
diff --git a/test/Modules/Inputs/linkage-merge-foo.h b/test/Modules/Inputs/linkage-merge-foo.h
index 7ed7775122..9cb62d2c0c 100644
--- a/test/Modules/Inputs/linkage-merge-foo.h
+++ b/test/Modules/Inputs/linkage-merge-foo.h
@@ -1 +1,2 @@
int f();
+static int g(int);
diff --git a/test/Modules/linkage-merge.cpp b/test/Modules/linkage-merge.cpp
index dafb0090e7..4e2ecef7d9 100644
--- a/test/Modules/linkage-merge.cpp
+++ b/test/Modules/linkage-merge.cpp
@@ -1,7 +1,13 @@
-// RUN: rm -rf %t
-// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -I %S/Inputs %s
+// FIXME: we should be able to put these in the .h file :-(
+// expected-note {{target of using declaration}}
+// expected-note {{using declaration}}
#include "linkage-merge-bar.h"
static int f(int);
int f(int);
+
+static void g(int); // expected-error {{declaration conflicts with target of using declaration already in scope}}
+
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -verify -fmodules -fmodules-cache-path=%t -I %S/Inputs %s