1 // RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
11 void *Thread(void *x
) {
12 static P p
= {rand(), rand()};
13 if (p
.x
> RAND_MAX
|| p
.y
> RAND_MAX
)
20 pthread_create(&t
[0], 0, Thread
, 0);
21 pthread_create(&t
[1], 0, Thread
, 0);
22 pthread_join(t
[0], 0);
23 pthread_join(t
[1], 0);
24 fprintf(stderr
, "PASS\n");
27 // CHECK-NOT: WARNING: ThreadSanitizer: data race