diff options
author | Renato Golin <renato.golin@linaro.org> | 2016-03-02 11:10:02 +0000 |
---|---|---|
committer | Renato Golin <renato.golin@linaro.org> | 2016-03-02 11:10:02 +0000 |
commit | f4faa6e4febbc20e71d0a625020b4f1c3237070e (patch) | |
tree | 4a12bab5aa596b09e8057032ae5913c5b74344c2 /test/tsan/vfork.cc | |
parent | 7fff5d88a3f43e24f54910cbb2a2c701113d6178 (diff) |
[RT] Make tsan tests more portable
by avoiding potential races when scanning stdout and stderr output.
Patch by Maxim Kuvyrkov.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@262476 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/tsan/vfork.cc')
-rw-r--r-- | test/tsan/vfork.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/tsan/vfork.cc b/test/tsan/vfork.cc index 98a82623e..fe83b2d20 100644 --- a/test/tsan/vfork.cc +++ b/test/tsan/vfork.cc @@ -27,7 +27,7 @@ int main() { pipe(fds); int pid = vfork(); if (pid < 0) { - printf("FAIL to vfork\n"); + fprintf(stderr, "FAIL to vfork\n"); exit(1); } if (pid == 0) { // child @@ -44,7 +44,7 @@ int main() { pthread_create(&t[1], NULL, Thread2, NULL); pthread_join(t[0], NULL); pthread_join(t[1], NULL); - printf("DONE\n"); + fprintf(stderr, "DONE\n"); } // CHECK-NOT: WARNING: ThreadSanitizer: data race |