freebsd-nq/test/tsan/thread_leak2.c

18 lines
325 B
C
Raw Normal View History

// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
2012-07-30 10:58:13 +00:00
#include <pthread.h>
2013-01-18 20:06:45 +00:00
#include <stdio.h>
2012-07-30 10:58:13 +00:00
void *Thread(void *x) {
return 0;
}
int main() {
pthread_t t;
pthread_create(&t, 0, Thread, 0);
pthread_detach(t);
fprintf(stderr, "PASS\n");
2012-07-30 10:58:13 +00:00
return 0;
}
// CHECK-NOT: WARNING: ThreadSanitizer: thread leak