2014-05-30 22:08:51 +08:00
|
|
|
// RUN: %clang_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
|
2012-05-10 22:18:22 +08:00
|
|
|
#include <pthread.h>
|
2013-03-22 00:55:17 +08:00
|
|
|
#include <unistd.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);
|
2013-03-22 00:55:17 +08:00
|
|
|
sleep(1);
|
2012-05-10 22:18:22 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK: WARNING: ThreadSanitizer: thread leak
|
2013-02-06 22:24:00 +08:00
|
|
|
// CHECK: SUMMARY: ThreadSanitizer: thread leak{{.*}}main
|