Home | History | Annotate | Download | only in tsan
      1 // RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
      2 
      3 #include <pthread.h>
      4 #include <rpc/xdr.h>
      5 #include <stdio.h>
      6 
      7 void *thr(void *p) {
      8   XDR xdrs;
      9   char buf[100];
     10   xdrmem_create(&xdrs, buf, sizeof(buf), XDR_ENCODE);
     11   xdr_destroy(&xdrs);
     12   return 0;
     13 }
     14 
     15 int main(int argc, char *argv[]) {
     16   pthread_t th[2];
     17   pthread_create(&th[0], 0, thr, 0);
     18   pthread_create(&th[1], 0, thr, 0);
     19   pthread_join(th[0], 0);
     20   pthread_join(th[1], 0);
     21   printf("DONE\n");
     22   // CHECK: DONE
     23   return 0;
     24 }
     25