summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/Lex/PPDirectives.cpp2
-rw-r--r--clang/test/Modules/Inputs/declare-use/module.map4
-rw-r--r--clang/test/Modules/Inputs/declare-use/s.h0
-rw-r--r--clang/test/Modules/declare-use.S5
-rw-r--r--clang/test/lit.cfg2
5 files changed, 11 insertions, 2 deletions
diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp
index 17b9b09d3e3..8ef3c918f33 100644
--- a/clang/lib/Lex/PPDirectives.cpp
+++ b/clang/lib/Lex/PPDirectives.cpp
@@ -600,7 +600,7 @@ const FileEntry *Preprocessor::LookupFile(
Filename, FilenameLoc, isAngled, FromDir, CurDir, Includers, SearchPath,
RelativePath, SuggestedModule, SkipCache);
if (FE) {
- if (SuggestedModule)
+ if (SuggestedModule && !LangOpts.AsmPreprocessor)
HeaderInfo.getModuleMap().diagnoseHeaderInclusion(
getModuleForLocation(FilenameLoc), FilenameLoc, Filename, FE);
return FE;
diff --git a/clang/test/Modules/Inputs/declare-use/module.map b/clang/test/Modules/Inputs/declare-use/module.map
index 40f071289a7..3b1b0e743e4 100644
--- a/clang/test/Modules/Inputs/declare-use/module.map
+++ b/clang/test/Modules/Inputs/declare-use/module.map
@@ -42,6 +42,10 @@ module XG {
module XH {
header "h.h"
header "h1.h"
+ header "s.h"
use XC
use XE
}
+
+module XS {
+}
diff --git a/clang/test/Modules/Inputs/declare-use/s.h b/clang/test/Modules/Inputs/declare-use/s.h
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/clang/test/Modules/Inputs/declare-use/s.h
diff --git a/clang/test/Modules/declare-use.S b/clang/test/Modules/declare-use.S
new file mode 100644
index 00000000000..28650b166b9
--- /dev/null
+++ b/clang/test/Modules/declare-use.S
@@ -0,0 +1,5 @@
+// RUN: rm -rf %t
+// RUN: %clang -fmodule-maps -fmodules-cache-path=%t -fmodules-decluse -fmodule-name=XS -I %S/Inputs/declare-use -c %s -Xclang -verify
+// expected-no-diagnostics
+
+#include "s.h"
diff --git a/clang/test/lit.cfg b/clang/test/lit.cfg
index ddfea8b0d8c..f7acb2f1568 100644
--- a/clang/test/lit.cfg
+++ b/clang/test/lit.cfg
@@ -44,7 +44,7 @@ else:
config.test_format = lit.formats.ShTest(execute_external)
# suffixes: A list of file extensions to treat as test files.
-config.suffixes = ['.c', '.cpp', '.m', '.mm', '.cu', '.ll', '.cl', '.s']
+config.suffixes = ['.c', '.cpp', '.m', '.mm', '.cu', '.ll', '.cl', '.s', '.S']
# excludes: A list of directories to exclude from the testsuite. The 'Inputs'
# subdirectories contain auxiliary inputs for various tests in their parent
OpenPOWER on IntegriCloud