Make sure clang puts tokens from different files on separate lines in "-E -P" mode. <rdar://problem/12774044>

llvm-svn: 171944
This commit is contained in:
Eli Friedman 2013-01-09 03:16:42 +00:00
parent d7678c6af5
commit c52435b4a2
3 changed files with 11 additions and 1 deletions

View File

@ -268,7 +268,10 @@ void PrintPPOutputPPCallbacks::FileChanged(SourceLocation Loc,
Lexer::Stringify(CurFilename);
FileType = NewFileType;
if (DisableLineMarkers) return;
if (DisableLineMarkers) {
startNewLineIfNeeded(/*ShouldUpdateCurrentLine=*/false);
return;
}
if (!Initialized) {
WriteLineInfo(CurLine);

View File

@ -0,0 +1,6 @@
// RUN: %clang_cc1 -E -P %s | FileCheck %s
// CHECK: int x;
// CHECK-NEXT: int x;
#include "print_line_include.h"
#include "print_line_include.h"

View File

@ -0,0 +1 @@
int x;