Home | History | Annotate | Download | only in lit_tests
      1 // RUN: %clang_tsan -O1 %s -o %t && %t 2>&1 | FileCheck %s
      2 #include <pthread.h>
      3 int Global;
      4 void *Thread1(void *x) {
      5   Global = 42;
      6   return x;
      7 }
      8 int main() {
      9   pthread_t t;
     10   pthread_create(&t, NULL, Thread1, NULL);
     11   Global = 43;
     12   pthread_join(t, NULL);
     13   return Global;
     14 }
     15 // CHECK: WARNING: ThreadSanitizer: data race
     16