aboutsummaryrefslogtreecommitdiff
path: root/test/Modules
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2013-03-21 01:08:50 +0000
committerDouglas Gregor <dgregor@apple.com>2013-03-21 01:08:50 +0000
commitcdf2808c4e735a717599751dcd2b434f239e1c68 (patch)
tree5fc928e9dcc83080ce96b9ef3a9980b54ea53bc0 /test/Modules
parentb9da713efb4277753211590953f433723908aade (diff)
<rdar://problem/13037793> Allow the names of modules to differ from the name of their subdirectory in the include path.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177621 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Modules')
-rw-r--r--test/Modules/Inputs/Modified/B.h2
-rw-r--r--test/Modules/Inputs/Modified/module.map4
-rw-r--r--test/Modules/Inputs/oldname/module.map4
-rw-r--r--test/Modules/Inputs/oldname/new_name.h1
-rw-r--r--test/Modules/modify-module.m6
-rw-r--r--test/Modules/renamed.m8
6 files changed, 19 insertions, 6 deletions
diff --git a/test/Modules/Inputs/Modified/B.h b/test/Modules/Inputs/Modified/B.h
index f50dd80ca4..52526b7f3a 100644
--- a/test/Modules/Inputs/Modified/B.h
+++ b/test/Modules/Inputs/Modified/B.h
@@ -1,3 +1,3 @@
-@import A;
+@import ModA;
int getB();
diff --git a/test/Modules/Inputs/Modified/module.map b/test/Modules/Inputs/Modified/module.map
index 50aaebc5c7..27b0d7062c 100644
--- a/test/Modules/Inputs/Modified/module.map
+++ b/test/Modules/Inputs/Modified/module.map
@@ -1,5 +1,5 @@
-module A { header "A.h" }
-module B {
+module ModA { header "A.h" }
+module ModB {
header "B.h"
export *
}
diff --git a/test/Modules/Inputs/oldname/module.map b/test/Modules/Inputs/oldname/module.map
new file mode 100644
index 0000000000..5812f869b3
--- /dev/null
+++ b/test/Modules/Inputs/oldname/module.map
@@ -0,0 +1,4 @@
+module NewName {
+ header "new_name.h"
+ export *
+}
diff --git a/test/Modules/Inputs/oldname/new_name.h b/test/Modules/Inputs/oldname/new_name.h
new file mode 100644
index 0000000000..8bf2f1c8c3
--- /dev/null
+++ b/test/Modules/Inputs/oldname/new_name.h
@@ -0,0 +1 @@
+int same_api;
diff --git a/test/Modules/modify-module.m b/test/Modules/modify-module.m
index decd07de08..953c917cdd 100644
--- a/test/Modules/modify-module.m
+++ b/test/Modules/modify-module.m
@@ -11,9 +11,9 @@
// RUN: %clang_cc1 -fdisable-module-hash -fmodules-cache-path=%t/cache -fmodules -I %t/include %s -verify
// RUN: echo 'int getA(); int getA2();' > %t/include/A.h
// RUN: %clang_cc1 -fdisable-module-hash -fmodules-cache-path=%t/cache -fmodules -I %t/include %s -verify
-// RUN: rm %t/cache/A.pcm
+// RUN: rm %t/cache/ModA.pcm
// RUN: %clang_cc1 -fdisable-module-hash -fmodules-cache-path=%t/cache -fmodules -I %t/include %s -verify
-// RUN: touch %t/cache/A.pcm
+// RUN: touch %t/cache/ModA.pcm
// RUN: %clang_cc1 -fdisable-module-hash -fmodules-cache-path=%t/cache -fmodules -I %t/include %s -verify
// expected-no-diagnostics
@@ -21,7 +21,7 @@
// FIXME: It is intended to suppress this on win32.
// REQUIRES: ansi-escape-sequences
-@import B;
+@import ModB;
int getValue() { return getA() + getB(); }
diff --git a/test/Modules/renamed.m b/test/Modules/renamed.m
new file mode 100644
index 0000000000..4e8f5329bb
--- /dev/null
+++ b/test/Modules/renamed.m
@@ -0,0 +1,8 @@
+@import NewName;
+
+int f() { return same_api; }
+
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -fmodules -I %S/Inputs -fmodules-cache-path=%t %s -verify
+
+// expected-no-diagnostics