1 // RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
3 #include <sanitizer/tsan_interface.h>
9 extern "C" const char *__tsan_default_options() {
10 return "report_bugs=0";
15 void *Thread1(void *x
) {
20 void *Thread2(void *x
) {
27 pthread_create(&t
[0], NULL
, Thread1
, NULL
);
28 pthread_create(&t
[1], NULL
, Thread2
, NULL
);
29 pthread_join(t
[0], NULL
);
30 pthread_join(t
[1], NULL
);
31 fprintf(stderr
, "DONE\n");
35 // CHECK-NOT: WARNING: ThreadSanitizer: data race