19 lines · c
1// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s2#include "test.h"3 4void *Thread(void *x) {5 sleep(100); // leave the thread "running"6 return 0;7}8 9int main() {10 pthread_t t;11 pthread_create(&t, 0, Thread, 0);12 fprintf(stderr, "DONE\n");13 return 0;14}15 16// CHECK: DONE17// CHECK-NOT: WARNING: ThreadSanitizer: thread leak18 19