2014-05-01 05:34:17 +08:00
|
|
|
// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
|
2012-05-10 22:18:22 +08:00
|
|
|
#include <pthread.h>
|
2012-09-18 15:23:54 +08:00
|
|
|
#include <stdio.h>
|
2012-05-10 22:18:22 +08:00
|
|
|
|
|
|
|
void *Thread(void *x) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
pthread_t t;
|
|
|
|
pthread_create(&t, 0, Thread, 0);
|
|
|
|
pthread_detach(t);
|
2016-04-15 20:34:00 +08:00
|
|
|
fprintf(stderr, "PASS\n");
|
2012-05-10 22:18:22 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK-NOT: WARNING: ThreadSanitizer: thread leak
|