]>
git.proxmox.com Git - rustc.git/blob - src/libcompiler_builtins/compiler-rt/test/tsan/ignore_race.cc
1 // RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
6 extern "C" void AnnotateIgnoreWritesBegin(const char *f
, int l
);
7 extern "C" void AnnotateIgnoreWritesEnd(const char *f
, int l
);
8 extern "C" void AnnotateIgnoreReadsBegin(const char *f
, int l
);
9 extern "C" void AnnotateIgnoreReadsEnd(const char *f
, int l
);
11 void *Thread(void *x
) {
12 AnnotateIgnoreWritesBegin(__FILE__
, __LINE__
);
13 AnnotateIgnoreReadsBegin(__FILE__
, __LINE__
);
15 AnnotateIgnoreReadsEnd(__FILE__
, __LINE__
);
16 AnnotateIgnoreWritesEnd(__FILE__
, __LINE__
);
17 barrier_wait(&barrier
);
22 barrier_init(&barrier
, 2);
24 pthread_create(&t
, 0, Thread
, 0);
25 barrier_wait(&barrier
);
28 fprintf(stderr
, "OK\n");
31 // CHECK-NOT: WARNING: ThreadSanitizer: data race