diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp index 17b9b09d3e3c..8ef3c918f337 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 40f071289a78..3b1b0e743e45 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 000000000000..e69de29bb2d1 diff --git a/clang/test/Modules/declare-use.S b/clang/test/Modules/declare-use.S new file mode 100644 index 000000000000..28650b166b9f --- /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 ddfea8b0d8c2..f7acb2f15684 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