1 // RUN: %clangxx_tsan -O1 %s -o %t && not %t 2>&1 | FileCheck %s 2 #include <pthread.h> 3 4 int X; 5 6 void *Thread1(void *x) { 7 X = 42; 8 X = 66; 9 X = 78; 10 return 0; 11 } 12 13 void *Thread2(void *x) { 14 X = 11; 15 X = 99; 16 X = 73; 17 return 0; 18 } 19 20 int main() { 21 pthread_t t; 22 pthread_create(&t, 0, Thread1, 0); 23 Thread2(0); 24 pthread_join(t, 0); 25 } 26 27 // CHECK: ThreadSanitizer: reported 1 warnings 28