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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171944 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eli Friedman 2013-01-09 03:16:42 +00:00
parent a0f2d02d16
commit 086cc83a84
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;