1 // RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
10 static void *racer(void *p
) {
18 while (wait(0) < 0) {}
24 pthread_create(&th1
, 0, racer
, &x
);
25 pthread_create(&th2
, 0, racer
, &x
);
32 fprintf(stderr
, "failed to fork (%d)\n", errno
);
35 fprintf(stderr
, "OK\n");
38 // CHECK: ThreadSanitizer: data race