diff options
Diffstat (limited to 'lib/tsan/lit_tests/thread_leak.c')
-rw-r--r-- | lib/tsan/lit_tests/thread_leak.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/tsan/lit_tests/thread_leak.c b/lib/tsan/lit_tests/thread_leak.c new file mode 100644 index 000000000000..c5e669e5d99f --- /dev/null +++ b/lib/tsan/lit_tests/thread_leak.c @@ -0,0 +1,17 @@ +// RUN: %clang_tsan -O1 %s -o %t && %t 2>&1 | FileCheck %s +#include <pthread.h> +#include <stdio.h> + +void *Thread(void *x) { + return 0; +} + +int main() { + pthread_t t; + pthread_create(&t, 0, Thread, 0); + pthread_join(t, 0); + printf("PASS\n"); + return 0; +} + +// CHECK-NOT: WARNING: ThreadSanitizer: thread leak |