1 // RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
6 void *Thread(void *x
) {
7 AnnotateIgnoreWritesBegin(__FILE__
, __LINE__
);
8 AnnotateIgnoreReadsBegin(__FILE__
, __LINE__
);
10 AnnotateIgnoreReadsEnd(__FILE__
, __LINE__
);
11 AnnotateIgnoreWritesEnd(__FILE__
, __LINE__
);
12 barrier_wait(&barrier
);
17 barrier_init(&barrier
, 2);
19 pthread_create(&t
, 0, Thread
, 0);
20 barrier_wait(&barrier
);
23 fprintf(stderr
, "OK\n");
26 // CHECK-NOT: WARNING: ThreadSanitizer: data race