Skip to content

Commit 53a656d

Browse files
authored
[utils/not] Disable coredumps when --crash is passed
We are expecting a crash, so it is unlikely that a coredump is going to be particularly useful. For debugging the program can always be run without the `not --crash` wrapper. Reviewed By: jh7370 Pull Request: #83704
1 parent 1da5db9 commit 53a656d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

llvm/utils/not/not.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// not --crash cmd
1212
// Will return true if cmd crashes (e.g. for testing crash reporting).
1313

14+
#include "llvm/Support/Process.h"
1415
#include "llvm/Support/Program.h"
1516
#include "llvm/Support/WithColor.h"
1617
#include "llvm/Support/raw_ostream.h"
@@ -41,6 +42,9 @@ int main(int argc, const char **argv) {
4142
setenv("LLVM_DISABLE_CRASH_REPORT", "1", 0);
4243
setenv("LLVM_DISABLE_SYMBOLIZATION", "1", 0);
4344
#endif
45+
// Try to disable coredumps for expected crashes as well since this can
46+
// noticeably slow down running the test suite.
47+
sys::Process::PreventCoreFiles();
4448
}
4549

4650
if (argc == 0)

0 commit comments

Comments
 (0)