Home | History | Annotate | Download | only in lit_tests
      1 // RUN: %clang_tsan -O1 %s -o %t && not %t 2>&1 | FileCheck %s
      2 #include <pthread.h>
      3 #include <unistd.h>
      4 
      5 void *Thread(void *x) {
      6   return 0;
      7 }
      8 
      9 int main() {
     10   for (int i = 0; i < 5; i++) {
     11     pthread_t t;
     12     pthread_create(&t, 0, Thread, 0);
     13   }
     14   sleep(1);
     15   return 0;
     16 }
     17 
     18 // CHECK: WARNING: ThreadSanitizer: thread leak
     19 // CHECK:   And 4 more similar thread leaks
     20