1 // RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
9 void *Thread1(void *x
) {
11 write(fds
[1], "a", 1);
15 void *Thread2(void *x
) {
17 while (read(fds
[0], &buf
, 1) != 1) {
26 pthread_create(&t
[0], NULL
, Thread1
, NULL
);
27 pthread_create(&t
[1], NULL
, Thread2
, NULL
);
28 pthread_join(t
[0], NULL
);
29 pthread_join(t
[1], NULL
);
30 fprintf(stderr
, "OK\n");
33 // CHECK-NOT: WARNING: ThreadSanitizer: data race