Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / tsan / force_background_thread.cpp
blobcf645cdfa9141f80c7b81e85e5fed9214635cc83
1 // RUN: %clangxx_tsan -O1 %s -o %t
2 // RUN: %deflake %env_tsan_opts=force_background_thread=0:verbosity=1:memory_limit_mb=1000 %run %t 2>&1 | FileCheck %s --implicit-check-not "memory flush check"
3 // RUN: %deflake %env_tsan_opts=force_background_thread=1:verbosity=1:memory_limit_mb=1000 %run %t 2>&1 | FileCheck %s --check-prefixes=CHECK,THREAD
4 // RUN: %deflake %env_tsan_opts=force_background_thread=0:verbosity=1:memory_limit_mb=1000 %run %t 1 2>&1 | FileCheck %s --check-prefixes=CHECK,THREAD
6 // Fails with: objc[99984]: task_restartable_ranges_register failed (result 0x2e: (os/kern) service not supported)
7 // UNSUPPORTED: darwin
9 #include "test.h"
11 void *Thread(void *a) { return nullptr; }
13 int main(int argc, char *argv[]) {
14 if (argc > 1) {
15 pthread_t t;
16 pthread_create(&t, nullptr, Thread, nullptr);
17 void *p;
18 pthread_join(t, &p);
20 sleep(3);
21 return 1;
24 // CHECK: Running under ThreadSanitizer
25 // THREAD: ThreadSanitizer: memory flush check