summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-12-17 10:31:37 +0000
committerDaniel Jasper <djasper@google.com>2013-12-17 10:31:37 +0000
commit0761a8a085f404482b375f71e670da8ef2ea612e (patch)
tree910ebae7cd5a93306422c0bceeb7bd0bfaf2ac3a /clang/test
parent59bb0878e21df577f5d92ffef509d88ed6da1a95 (diff)
downloadbcm5719-llvm-0761a8a085f404482b375f71e670da8ef2ea612e.tar.gz
bcm5719-llvm-0761a8a085f404482b375f71e670da8ef2ea612e.zip
Modules: Don't warn upon missing headers while reading the module map.
Instead, mark the module as unavailable so that clang errors as soon as someone tries to build this module. This works towards the long-term goal of not stat'ing the header files at all while reading the module map and instead read them only when the module is being built (there is a corresponding FIXME in parseHeaderDecl()). However, it seems non-trivial to get there and this unblock us and moves us into the right direction. Also changed the implementation to reuse the same DiagnosticsEngine. llvm-svn: 197485
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Modules/Inputs/submodules/module.map5
-rw-r--r--clang/test/Modules/Inputs/unnecessary-module-map-parsing/module.map2
-rw-r--r--clang/test/Modules/submodules.cpp5
-rw-r--r--clang/test/Modules/unnecessary-module-map-parsing.c2
4 files changed, 12 insertions, 2 deletions
diff --git a/clang/test/Modules/Inputs/submodules/module.map b/clang/test/Modules/Inputs/submodules/module.map
index c91e94f47d2..15931031abb 100644
--- a/clang/test/Modules/Inputs/submodules/module.map
+++ b/clang/test/Modules/Inputs/submodules/module.map
@@ -10,3 +10,8 @@ module import_self {
module c { header "import-self-c.h" }
module d { header "import-self-d.h" }
}
+
+module missing_headers {
+ module missing { header "missing.h" }
+ module not_missing { header "not_missing.h" }
+}
diff --git a/clang/test/Modules/Inputs/unnecessary-module-map-parsing/module.map b/clang/test/Modules/Inputs/unnecessary-module-map-parsing/module.map
index 2d2104177ff..6d4ceeeb0cc 100644
--- a/clang/test/Modules/Inputs/unnecessary-module-map-parsing/module.map
+++ b/clang/test/Modules/Inputs/unnecessary-module-map-parsing/module.map
@@ -1,3 +1,3 @@
module a {
- header "unknown.h"
+ eader "unknown.h"
}
diff --git a/clang/test/Modules/submodules.cpp b/clang/test/Modules/submodules.cpp
index 9c62389eadc..12bf87f6307 100644
--- a/clang/test/Modules/submodules.cpp
+++ b/clang/test/Modules/submodules.cpp
@@ -34,3 +34,8 @@ extern MyTypeC import_self_test_c;
// FIXME: This should be valid; import_self.b re-exports import_self.d.
extern MyTypeD import_self_test_d; // expected-error {{must be imported from module 'import_self.d'}}
// expected-note@import-self-d.h:1 {{here}}
+
+// expected-error@Inputs/submodules/module.map:15{{header 'missing.h' not found}}
+@import missing_headers.missing;
+@import missing_headers.not_missing;
+void f() { NotMissingFunction(); };
diff --git a/clang/test/Modules/unnecessary-module-map-parsing.c b/clang/test/Modules/unnecessary-module-map-parsing.c
index 16f7086a6d7..4c83448179e 100644
--- a/clang/test/Modules/unnecessary-module-map-parsing.c
+++ b/clang/test/Modules/unnecessary-module-map-parsing.c
@@ -3,6 +3,6 @@
// RUN: not %clang_cc1 -fmodules -I %S/Inputs/unnecessary-module-map-parsing -fsyntax-only %s 2>&1 | FileCheck %s
// RUN: %clang_cc1 -I %S/Inputs/unnecessary-module-map-parsing -fsyntax-only %s
-// CHECK: error: header 'unknown.h' not found
+// CHECK: error: expected umbrella, header, submodule, or module export
#include "a1.h"
OpenPOWER on IntegriCloud