[ASan/Win] Add a comment about DCL-using-static vs threads
[blocksruntime.git] / test / tsan / suppress_same_address.cc
blobc1721409a5e027c828935356ff9d08cf1c43009e
1 // RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s
2 #include <pthread.h>
3 #include <unistd.h>
5 volatile int X;
7 void *Thread1(void *x) {
8 sleep(1);
9 X = 42;
10 X = 66;
11 X = 78;
12 return 0;
15 void *Thread2(void *x) {
16 X = 11;
17 X = 99;
18 X = 73;
19 return 0;
22 int main() {
23 pthread_t t;
24 pthread_create(&t, 0, Thread1, 0);
25 Thread2(0);
26 pthread_join(t, 0);
29 // CHECK: ThreadSanitizer: reported 1 warnings