Home | History | Annotate | Download | only in lit_tests
      1 // RUN: %clangxx_tsan -O1 %s -o %t && not %t 2>&1 | FileCheck %s
      2 #include <pthread.h>
      3 #include <stddef.h>
      4 
      5 void *Thread(void *a) {
      6   *(int*)a = 43;
      7   return 0;
      8 }
      9 
     10 int main() {
     11   static __thread int Var = 42;
     12   pthread_t t;
     13   pthread_create(&t, 0, Thread, &Var);
     14   Var = 43;
     15   pthread_join(t, 0);
     16 }
     17 
     18 // CHECK: WARNING: ThreadSanitizer: data race
     19 // CHECK:   Location is TLS of main thread.
     20