Skip to content

Commit 30daa7a

Browse files
committed
Revert fixing up ExecutionFailed, remove the test for ExecutionFailed instead
1 parent 3f3e4c7 commit 30daa7a

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

llvm/lib/Support/Program.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,6 @@ int sys::ExecuteAndWait(StringRef Program, ArrayRef<StringRef> Args,
4545
ProcessInfo Result = Wait(
4646
PI, SecondsToWait == 0 ? std::nullopt : std::optional(SecondsToWait),
4747
ErrMsg, ProcStat);
48-
49-
if (ExecutionFailed && Result.ReturnCode < 0)
50-
*ExecutionFailed = true;
51-
5248
return Result.ReturnCode;
5349
}
5450

llvm/unittests/Support/ProgramTest.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,10 +422,13 @@ TEST(ProgramTest, TestExecuteNegative) {
422422
bool ExecutionFailed;
423423
int RetCode = ExecuteAndWait(Executable, argv, std::nullopt, {}, 0, 0,
424424
&Error, &ExecutionFailed);
425+
425426
EXPECT_LT(RetCode, 0) << "On error ExecuteAndWait should return 0 or "
426427
"positive value indicating the result code";
427-
EXPECT_TRUE(ExecutionFailed);
428428
EXPECT_FALSE(Error.empty());
429+
430+
// Note ExecutionFailed may or may not be false. When using fork, the error
431+
// is produced on the wait for the child, not the execution point.
429432
}
430433

431434
{

0 commit comments

Comments
 (0)