summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/Frontend/PrintPreprocessedOutput.cpp4
-rw-r--r--clang/test/Modules/preprocess.cpp4
2 files changed, 6 insertions, 2 deletions
diff --git a/clang/lib/Frontend/PrintPreprocessedOutput.cpp b/clang/lib/Frontend/PrintPreprocessedOutput.cpp
index 9524b58e3a2..77b80e612fb 100644
--- a/clang/lib/Frontend/PrintPreprocessedOutput.cpp
+++ b/clang/lib/Frontend/PrintPreprocessedOutput.cpp
@@ -336,7 +336,9 @@ void PrintPPOutputPPCallbacks::InclusionDirective(SourceLocation HashLoc,
OS << "#include "
<< (IsAngled ? '<' : '"')
<< FileName
- << (IsAngled ? '>' : '"');
+ << (IsAngled ? '>' : '"')
+ << " /* clang -E: implicit import for module "
+ << Imported->getFullModuleName() << " */";
}
// Since we want a newline after the @import, but not a #<line>, start a new
// line immediately.
diff --git a/clang/test/Modules/preprocess.cpp b/clang/test/Modules/preprocess.cpp
index aa28191722a..0615331c8bd 100644
--- a/clang/test/Modules/preprocess.cpp
+++ b/clang/test/Modules/preprocess.cpp
@@ -1,6 +1,6 @@
// RUN: rm -rf %t
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I %S/Inputs -x c++ -E %s | \
-// RUN: FileCheck -strict-whitespace %s --check-prefix=CHECK --check-prefix=CXX
+// RUN: FileCheck -strict-whitespace %s --check-prefix=CHECK --check-prefix=CXX --check-prefix=CXX-DASHE
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I %S/Inputs -x objective-c -E %s | \
// RUN: FileCheck -strict-whitespace %s --check-prefix=CHECK --check-prefix=OBJC
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I %S/Inputs -x c++ -E -frewrite-includes %s | \
@@ -14,7 +14,9 @@ foo bar baz
// The weird {{ }} here is to prevent the -frewrite-includes test from matching its own CHECK lines.
// CXX: #include{{ }}"dummy.h"
+// CXX-DASHE-SAME: /* clang -E: implicit import for module dummy */
// CXX: #include{{ }}"dummy.h"
+// CXX-DASHE-SAME: /* clang -E: implicit import for module dummy */
// CXX: foo bar baz
// OBJC: @import{{ }}dummy; /* clang
OpenPOWER on IntegriCloud