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 @@ -13,6 +13,7 @@ #include #include #include +#include __attribute__((noinline)) void foo() { printf("foo\n"); } @@ -32,6 +33,9 @@ fprintf(stderr, "Parent PID: %d\n", getpid()); foo(); bar(); + + // Wait for the child process(s) to finish + while(wait(NULL) > 0); } return 0; }