1 // RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s
4 const int kThreads
= 16;
5 const int kIters
= 1000;
10 for (int i
= 0; i
< kIters
; i
++)
16 pthread_t th
[kThreads
];
17 for (int i
= 0; i
< kThreads
; i
++)
18 pthread_create(&th
[i
], 0, thr
, 0);
19 for (int i
= 0; i
< kThreads
; i
++)
20 pthread_join(th
[i
], 0);
21 fprintf(stderr
, "DONE\n");
24 // CHECK: ThreadSanitizer: data race