diff --git a/compiler-rt/test/asan/TestCases/Posix/coverage-fork.cpp b/compiler-rt/test/asan/TestCases/Posix/coverage-fork.cpp --- a/compiler-rt/test/asan/TestCases/Posix/coverage-fork.cpp +++ b/compiler-rt/test/asan/TestCases/Posix/coverage-fork.cpp @@ -12,6 +12,7 @@ #include #include +#include #include __attribute__((noinline)) @@ -32,6 +33,10 @@ fprintf(stderr, "Parent PID: %d\n", getpid()); foo(); bar(); + + // Wait for the child process(s) to finish + while (wait(NULL) > 0) + ; } return 0; }