1 // RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
23 void *Thread(void *x
) {
24 for (int i
= 0; i
< 1000; ++i
) {
32 pthread_create(&t
[0], 0, Thread
, 0);
33 pthread_create(&t
[1], 0, Thread
, 0);
34 pthread_join(t
[0], 0);
35 pthread_join(t
[1], 0);
36 fprintf(stderr
, "PASS\n");
39 // CHECK-NOT: WARNING: ThreadSanitizer: data race