Skip to content

Commit 3c144ab

Browse files
Only return signals on Unix
1 parent cea1b1c commit 3c144ab

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,16 @@ class InProcessFunctionExecutorImpl : public BenchmarkRunner::FunctionExecutor {
147147
CrashRecoveryContext::Disable();
148148
PS.reset();
149149
if (Crashed) {
150+
#ifdef LLVM_ON_UNIX
150151
// See "Exit Status for Commands":
151152
// https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xcu_chap02.html
152153
constexpr const int kSigOffset = 128;
153154
return make_error<SnippetSignal>(CRC.RetCode - kSigOffset);
155+
#else
156+
// The exit code of the process on windows is not meaningful as a
157+
// signal, so simply pass in -1 as the signal into the error.
158+
return make_error<SnippetSignal>(-1);
159+
#endif // LLVM_ON_UNIX
154160
}
155161
}
156162

0 commit comments

Comments
 (0)