Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / tsan / thread_detach.c
blob2a95742b7cd86965836f36b8f6c4b972dc3cb8f3
1 // RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
2 #include "test.h"
4 void *Thread(void *x) {
5 barrier_wait(&barrier);
6 return 0;
9 int main() {
10 barrier_init(&barrier, 2);
11 pthread_t t;
12 pthread_create(&t, 0, Thread, 0);
13 barrier_wait(&barrier);
14 pthread_detach(t);
15 fprintf(stderr, "PASS\n");
16 return 0;
19 // CHECK-NOT: WARNING: ThreadSanitizer: thread leak
20 // CHECK: PASS