2015-01-07 19:55:37 +00:00
|
|
|
// 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);
|
2016-07-23 20:45:36 +00:00
|
|
|
fprintf(stderr, "PASS\n");
|
2012-07-30 10:58:13 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK-NOT: WARNING: ThreadSanitizer: thread leak
|