forked from OSchip/llvm-project
Fix PCH/preprocess test to be more useful, and unbreak -E mode with implicit
PCH, which I broke. llvm-svn: 86921
This commit is contained in:
parent
d5e25436a1
commit
f4408a29e1
|
@ -1,5 +1,8 @@
|
|||
// RUN: clang-cc -emit-pch -o %t %S/preprocess.h
|
||||
// RUN: clang-cc -include-pch %t -E -o - %s | grep -c "a_typedef" | count 1
|
||||
#include "preprocess.h"
|
||||
// Check that -E mode is invariant when using an implicit PCH.
|
||||
|
||||
int a_value;
|
||||
// RUN: clang-cc -include %S/preprocess.h -E -o %t.orig %s
|
||||
// RUN: clang-cc -emit-pch -o %t %S/preprocess.h
|
||||
// RUN: clang-cc -include-pch %t -E -o %t.from_pch %s
|
||||
// RUN: diff %t.orig %t.from_pch
|
||||
|
||||
a_typedef a_value;
|
||||
|
|
|
@ -783,7 +783,7 @@ static void ProcessInputFile(const CompilerInvocation &CompOpts,
|
|||
|
||||
const std::string &ImplicitPCHInclude =
|
||||
CompOpts.getPreprocessorOpts().getImplicitPCHInclude();
|
||||
if (!ImplicitPCHInclude.empty()) {
|
||||
if (Consumer && !ImplicitPCHInclude.empty()) {
|
||||
// If the user specified -isysroot, it will be used for relocatable PCH
|
||||
// files.
|
||||
const char *isysrootPCH = CompOpts.getHeaderSearchOpts().Sysroot.c_str();
|
||||
|
@ -820,6 +820,18 @@ static void ProcessInputFile(const CompilerInvocation &CompOpts,
|
|||
return;
|
||||
}
|
||||
|
||||
// Finish preprocessor initialization. We do this now (rather
|
||||
// than earlier) because this initialization creates new source
|
||||
// location entries in the source manager, which must come after
|
||||
// the source location entries for the PCH file.
|
||||
if (InitializeSourceManager(PP, InFile))
|
||||
return;
|
||||
} else if (!ImplicitPCHInclude.empty()) {
|
||||
// If we have an implicit PCH, the source manager initialization was
|
||||
// delayed, do it now.
|
||||
//
|
||||
// FIXME: Clean this up.
|
||||
|
||||
// Finish preprocessor initialization. We do this now (rather
|
||||
// than earlier) because this initialization creates new source
|
||||
// location entries in the source manager, which must come after
|
||||
|
|
Loading…
Reference in New Issue