summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules/normal-module-map.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-12-08 19:11:24 +0000
committerDouglas Gregor <dgregor@apple.com>2011-12-08 19:11:24 +0000
commit524e33e1f8d614926b56f83e123d915d43543c2d (patch)
tree1c44c6640b704afcd3c1c8f9914dee2f514a7969 /clang/test/Modules/normal-module-map.cpp
parent5780f9df56ec5efda7e40df8a88d8c6057663033 (diff)
downloadbcm5719-llvm-524e33e1f8d614926b56f83e123d915d43543c2d.tar.gz
bcm5719-llvm-524e33e1f8d614926b56f83e123d915d43543c2d.zip
Implement umbrella directories for modules, which are similar to
umbrella headers in the sense that all of the headers within that directory (and eventually its subdirectories) are considered to be part of the module with that umbrella directory. However, unlike umbrella headers, which are expected to include all of the headers within their subdirectories, Clang will automatically include all of the headers it finds in the named subdirectory. The intent here is to allow a module map to trivially turn a subdirectory into a module, where the module's structure can mimic the directory structure. llvm-svn: 146165
Diffstat (limited to 'clang/test/Modules/normal-module-map.cpp')
-rw-r--r--clang/test/Modules/normal-module-map.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/test/Modules/normal-module-map.cpp b/clang/test/Modules/normal-module-map.cpp
index 19294950d49..5a7d549053d 100644
--- a/clang/test/Modules/normal-module-map.cpp
+++ b/clang/test/Modules/normal-module-map.cpp
@@ -1,3 +1,5 @@
+// Note: inside the module. expected-note{{ 'nested_umbrella_a' declared here}}
+
// RUN: rm -rf %t
// RUN: %clang_cc1 -x objective-c -fmodule-cache-path %t -fauto-module-import -I %S/Inputs/normal-module-map %s -verify
#include "Umbrella/umbrella_sub.h"
@@ -15,3 +17,19 @@ __import_module__ Umbrella2;
int test() {
return a1 + b1 + nested2;
}
+
+__import_module__ nested_umbrella.a;
+
+int testNestedUmbrellaA() {
+ return nested_umbrella_a;
+}
+
+int testNestedUmbrellaBFail() {
+ return nested_umbrella_b; // expected-error{{use of undeclared identifier 'nested_umbrella_b'; did you mean 'nested_umbrella_a'?}}
+}
+
+__import_module__ nested_umbrella.b;
+
+int testNestedUmbrellaB() {
+ return nested_umbrella_b;
+}
OpenPOWER on IntegriCloud