summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-12-20 00:28:52 +0000
committerDouglas Gregor <dgregor@apple.com>2011-12-20 00:28:52 +0000
commit98a52db80c80fb45adb65a341c1dae62dcc364a2 (patch)
tree0ec00c68dea7a0616b3eba390f2e7e191510e4b7 /clang/test/Modules
parent9eb3f00406abcb3498b3e5e702eb69a9612a88bc (diff)
downloadbcm5719-llvm-98a52db80c80fb45adb65a341c1dae62dcc364a2.tar.gz
bcm5719-llvm-98a52db80c80fb45adb65a341c1dae62dcc364a2.zip
Detect when mapping a #include/#import over to a submodule ends up
hitting a submodule that was never actually created, e.g., because that header wasn't parsed. In such cases, complain (because the module's umbrella headers don't cover everything) and fall back to including the header. Later, we'll add a warning at module-build time to catch all such cases. However, this fallback is important to eliminate assertions in the ASTWriter when this happens. llvm-svn: 146933
Diffstat (limited to 'clang/test/Modules')
-rw-r--r--clang/test/Modules/Inputs/Module.framework/Headers/NotInModule.h1
-rw-r--r--clang/test/Modules/auto-module-import.m9
2 files changed, 10 insertions, 0 deletions
diff --git a/clang/test/Modules/Inputs/Module.framework/Headers/NotInModule.h b/clang/test/Modules/Inputs/Module.framework/Headers/NotInModule.h
new file mode 100644
index 00000000000..6b15791eb2c
--- /dev/null
+++ b/clang/test/Modules/Inputs/Module.framework/Headers/NotInModule.h
@@ -0,0 +1 @@
+int not_in_module;
diff --git a/clang/test/Modules/auto-module-import.m b/clang/test/Modules/auto-module-import.m
index 21e79687610..d14f9e90304 100644
--- a/clang/test/Modules/auto-module-import.m
+++ b/clang/test/Modules/auto-module-import.m
@@ -62,3 +62,12 @@ int getModulePrivate() { return module_private; }
int getNoUmbrellaAPrivate() { return no_umbrella_A_private; }
int getNoUmbrellaBPrivateFail() { return no_umbrella_B_private; } // expected-error{{use of undeclared identifier 'no_umbrella_B_private'; did you mean 'no_umbrella_A_private'?}}
+
+// Test inclusion of headers that are under an umbrella directory but
+// not actually part of the module.
+#include <Module/NotInModule.h> // expected-warning{{treating #include as an import of module 'Module.NotInModule'}} \
+ // expected-warning{{missing submodule 'Module.NotInModule'}}
+
+int getNotInModule() {
+ return not_in_module;
+}
OpenPOWER on IntegriCloud