[test][clangd] Fix use-after-return after 72142fbac4

This commit is contained in:
Vitaly Buka 2022-09-11 11:46:49 -07:00
parent cbb3a39e4d
commit dde62a575a
1 changed files with 3 additions and 0 deletions

View File

@ -1227,12 +1227,15 @@ TEST_F(TUSchedulerTests, IncluderCache) {
auto GetFlags = [&](PathRef Header) {
S.update(Header, getInputs(Header, ";"), WantDiagnostics::Yes);
EXPECT_TRUE(S.blockUntilIdle(timeoutSeconds(10)));
Notification CmdDone;
tooling::CompileCommand Cmd;
S.runWithPreamble("GetFlags", Header, TUScheduler::StaleOrAbsent,
[&](llvm::Expected<InputsAndPreamble> Inputs) {
ASSERT_FALSE(!Inputs) << Inputs.takeError();
Cmd = std::move(Inputs->Command);
CmdDone.notify();
});
CmdDone.wait();
EXPECT_TRUE(S.blockUntilIdle(timeoutSeconds(10)));
return Cmd.CommandLine;
};