diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-12-08 19:11:24 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-12-08 19:11:24 +0000 |
commit | 77d029f6a24dbf70d97e61757945df53fb250ea0 (patch) | |
tree | a5b04a494d0f58aa79d0523e53213a842ffe5dd2 /test/Modules/normal-module-map.cpp | |
parent | d5c3fa29c6a06ed9c74e03b4a96f786cbc156b7c (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146165 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Modules/normal-module-map.cpp')
-rw-r--r-- | test/Modules/normal-module-map.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/Modules/normal-module-map.cpp b/test/Modules/normal-module-map.cpp index 19294950d4..5a7d549053 100644 --- a/test/Modules/normal-module-map.cpp +++ b/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; +} |