When emitting a preprocessed file with implicit module imports, make sure line directives are emitted in the next line.

rdar://13722737

llvm-svn: 180718
This commit is contained in:
Argyrios Kyrtzidis 2013-04-29 17:26:22 +00:00
parent b5ad4ec7a3
commit c3b4b79beb
2 changed files with 5 additions and 0 deletions

View File

@ -335,6 +335,7 @@ void PrintPPOutputPPCallbacks::InclusionDirective(SourceLocation HashLoc,
MoveToLine(HashLoc);
OS << "@import " << Imported->getFullModuleName() << ";"
<< " /* clang -E: implicit import for \"" << File->getName() << "\" */";
EmittedTokensOnThisLine = true;
}
}

View File

@ -9,3 +9,7 @@ int bar();
int foo();
// CHECK: @import Module; /* clang -E: implicit import for "{{.*Headers[/\\]Module.h}}" */
#include <Module/Module.h>
#include "pp-modules.h" // CHECK: # 1 "{{.*}}pp-modules.h" 1
// CHECK: @import Module; /* clang -E: implicit import for "{{.*}}Module.h" */{{$}}
// CHECK: # 14 "{{.*}}pp-modules.c" 2