summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--compiler-rt/lib/tsan/rtl/tsan_interceptors.cc8
-rw-r--r--compiler-rt/test/tsan/fork_atexit.cc1
-rw-r--r--compiler-rt/test/tsan/fork_deadlock.cc1
-rw-r--r--compiler-rt/test/tsan/fork_multithreaded.cc1
-rw-r--r--compiler-rt/test/tsan/fork_multithreaded3.cc1
-rw-r--r--compiler-rt/test/tsan/vfork.cc1
6 files changed, 7 insertions, 6 deletions
diff --git a/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc b/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc
index f78103ebc25..f4e1dfb43e0 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc
+++ b/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc
@@ -2168,7 +2168,13 @@ TSAN_INTERCEPTOR(int, fork, int fake) {
return REAL(fork)(fake);
SCOPED_INTERCEPTOR_RAW(fork, fake);
ForkBefore(thr, pc);
- int pid = REAL(fork)(fake);
+ int pid;
+ {
+ // On OS X, REAL(fork) can call intercepted functions (OSSpinLockLock), and
+ // we'll assert in CheckNoLocks() unless we ignore interceptors.
+ ScopedIgnoreInterceptors ignore;
+ pid = REAL(fork)(fake);
+ }
if (pid == 0) {
// child
ForkChildAfter(thr, pc);
diff --git a/compiler-rt/test/tsan/fork_atexit.cc b/compiler-rt/test/tsan/fork_atexit.cc
index 51a64fc264d..15cf0a2485c 100644
--- a/compiler-rt/test/tsan/fork_atexit.cc
+++ b/compiler-rt/test/tsan/fork_atexit.cc
@@ -1,5 +1,4 @@
// RUN: %clangxx_tsan -O1 %s -o %t && %env_tsan_opts=atexit_sleep_ms=50 %run %t 2>&1 | FileCheck %s
-// UNSUPPORTED: darwin
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/compiler-rt/test/tsan/fork_deadlock.cc b/compiler-rt/test/tsan/fork_deadlock.cc
index 22bed086f7d..5dce990bff9 100644
--- a/compiler-rt/test/tsan/fork_deadlock.cc
+++ b/compiler-rt/test/tsan/fork_deadlock.cc
@@ -1,5 +1,4 @@
// RUN: %clangxx_tsan -O1 %s -o %t && %env_tsan_opts=atexit_sleep_ms=50 %run %t 2>&1 | FileCheck %s
-// UNSUPPORTED: darwin
#include "test.h"
#include <errno.h>
#include <sys/types.h>
diff --git a/compiler-rt/test/tsan/fork_multithreaded.cc b/compiler-rt/test/tsan/fork_multithreaded.cc
index b345f58ad0c..33eef93c8ec 100644
--- a/compiler-rt/test/tsan/fork_multithreaded.cc
+++ b/compiler-rt/test/tsan/fork_multithreaded.cc
@@ -1,6 +1,5 @@
// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s -check-prefix=CHECK-DIE
// RUN: %clangxx_tsan -O1 %s -o %t && %env_tsan_opts=die_after_fork=0 %run %t 2>&1 | FileCheck %s -check-prefix=CHECK-NODIE
-// UNSUPPORTED: darwin
#include "test.h"
#include <errno.h>
#include <sys/types.h>
diff --git a/compiler-rt/test/tsan/fork_multithreaded3.cc b/compiler-rt/test/tsan/fork_multithreaded3.cc
index 5b8c13eb8b8..a651b3c18b4 100644
--- a/compiler-rt/test/tsan/fork_multithreaded3.cc
+++ b/compiler-rt/test/tsan/fork_multithreaded3.cc
@@ -1,5 +1,4 @@
// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-// UNSUPPORTED: darwin
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
diff --git a/compiler-rt/test/tsan/vfork.cc b/compiler-rt/test/tsan/vfork.cc
index 98a82623ee6..5ae1dd1abab 100644
--- a/compiler-rt/test/tsan/vfork.cc
+++ b/compiler-rt/test/tsan/vfork.cc
@@ -1,5 +1,4 @@
// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-// UNSUPPORTED: darwin
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
OpenPOWER on IntegriCloud