[Frontend] Fix broken createInvocation test due to bad merge

This commit is contained in:
Sam McCall 2022-05-06 17:05:47 +02:00
parent 687ccba198
commit f44552ab38
1 changed files with 6 additions and 4 deletions

View File

@ -49,14 +49,16 @@ TEST(BuildCompilerInvocationTest, ProbePrecompiled) {
clang::CompilerInstance::createDiagnostics(new DiagnosticOptions, &D, clang::CompilerInstance::createDiagnostics(new DiagnosticOptions, &D,
false); false);
// Default: ProbePrecompiled is true. // Default: ProbePrecompiled is true.
std::unique_ptr<CompilerInvocation> CI = createInvocationFromCommandLine( CreateInvocationOptions CIOpts;
Args, CommandLineDiagsEngine, FS, false, nullptr); CIOpts.Diags = CommandLineDiagsEngine;
CIOpts.VFS = FS;
std::unique_ptr<CompilerInvocation> CI = createInvocation(Args, CIOpts);
ASSERT_TRUE(CI); ASSERT_TRUE(CI);
EXPECT_THAT(CI->getPreprocessorOpts().Includes, ElementsAre()); EXPECT_THAT(CI->getPreprocessorOpts().Includes, ElementsAre());
EXPECT_EQ(CI->getPreprocessorOpts().ImplicitPCHInclude, "foo.h.pch"); EXPECT_EQ(CI->getPreprocessorOpts().ImplicitPCHInclude, "foo.h.pch");
CI = createInvocationFromCommandLine(Args, CommandLineDiagsEngine, FS, false, CIOpts.ProbePrecompiled = false;
nullptr, /*ProbePrecompiled=*/false); CI = createInvocation(Args, CIOpts);
ASSERT_TRUE(CI); ASSERT_TRUE(CI);
EXPECT_THAT(CI->getPreprocessorOpts().Includes, ElementsAre("foo.h")); EXPECT_THAT(CI->getPreprocessorOpts().Includes, ElementsAre("foo.h"));
EXPECT_EQ(CI->getPreprocessorOpts().ImplicitPCHInclude, ""); EXPECT_EQ(CI->getPreprocessorOpts().ImplicitPCHInclude, "");