llvm-project
17 строк · 326.0 Байт
1// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
2#include <pthread.h>3#include <stdio.h>4
5void *Thread(void *x) {6return 0;7}
8
9int main() {10pthread_t t;11pthread_create(&t, 0, Thread, 0);12pthread_join(t, 0);13fprintf(stderr, "PASS\n");14return 0;15}
16
17// CHECK-NOT: WARNING: ThreadSanitizer: thread leak
18