1 // RUN: %clangxx_tsan -O1 %s -o %t && %t 2>&1 | FileCheck %s -check-prefix=CHECK-DIE
2 // RUN: %clangxx_tsan -O1 %s -o %t && TSAN_OPTIONS="die_after_fork=0" %t 2>&1 | FileCheck %s -check-prefix=CHECK-NODIE
11 static void *sleeper(void *p
) {
18 pthread_create(&th
, 0, sleeper
, 0);
21 while (wait(0) < 0) {}
26 pthread_create(&th2
, 0, sleeper
, 0);
31 fprintf(stderr
, "failed to fork (%d)\n", errno
);
34 fprintf(stderr
, "OK\n");
37 // CHECK-DIE: ThreadSanitizer: starting new threads after multi-threaded fork is not supported
40 // CHECK-NODIE-NOT: ThreadSanitizer: starting new threads after multi-threaded fork is not supported