diff --git a/compiler-rt/test/tsan/atomic_free.cc b/compiler-rt/test/tsan/atomic_free.cc index c36b8fb3655a..1dcf887c41d5 100644 --- a/compiler-rt/test/tsan/atomic_free.cc +++ b/compiler-rt/test/tsan/atomic_free.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include diff --git a/compiler-rt/test/tsan/atomic_free2.cc b/compiler-rt/test/tsan/atomic_free2.cc index 11204ba77d00..c50be6bba940 100644 --- a/compiler-rt/test/tsan/atomic_free2.cc +++ b/compiler-rt/test/tsan/atomic_free2.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include diff --git a/compiler-rt/test/tsan/atomic_race.cc b/compiler-rt/test/tsan/atomic_race.cc index e64ef96ed4b3..ca444b42b5b9 100644 --- a/compiler-rt/test/tsan/atomic_race.cc +++ b/compiler-rt/test/tsan/atomic_race.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include #include diff --git a/compiler-rt/test/tsan/atomic_stack.cc b/compiler-rt/test/tsan/atomic_stack.cc index d28b5b962c75..7e3176f8e784 100644 --- a/compiler-rt/test/tsan/atomic_stack.cc +++ b/compiler-rt/test/tsan/atomic_stack.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include diff --git a/compiler-rt/test/tsan/cond_race.cc b/compiler-rt/test/tsan/cond_race.cc index 375bd920a1b7..fa42fafca4d2 100644 --- a/compiler-rt/test/tsan/cond_race.cc +++ b/compiler-rt/test/tsan/cond_race.cc @@ -1,4 +1,4 @@ -// RUN: %clang_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clang_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s // CHECK-NOT: unlock of unlocked mutex // CHECK: ThreadSanitizer: data race // CHECK: pthread_cond_signal diff --git a/compiler-rt/test/tsan/deadlock_detector_stress_test.cc b/compiler-rt/test/tsan/deadlock_detector_stress_test.cc index ac9fcbd5eef7..53624782e07b 100644 --- a/compiler-rt/test/tsan/deadlock_detector_stress_test.cc +++ b/compiler-rt/test/tsan/deadlock_detector_stress_test.cc @@ -1,12 +1,12 @@ // RUN: %clangxx_tsan %s -o %t -DLockType=PthreadMutex -// RUN: TSAN_OPTIONS=detect_deadlocks=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-NOT-SECOND -// TSAN_OPTIONS="detect_deadlocks=1 second_deadlock_stack=1" not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-SECOND +// RUN: TSAN_OPTIONS=detect_deadlocks=1 %deflake %run %t | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-NOT-SECOND +// TSAN_OPTIONS="detect_deadlocks=1 second_deadlock_stack=1" %deflake %run %t | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-SECOND // RUN: %clangxx_tsan %s -o %t -DLockType=PthreadSpinLock -// RUN: TSAN_OPTIONS=detect_deadlocks=1 not %run %t 2>&1 | FileCheck %s +// RUN: TSAN_OPTIONS=detect_deadlocks=1 %deflake %run %t | FileCheck %s // RUN: %clangxx_tsan %s -o %t -DLockType=PthreadRWLock -// RUN: TSAN_OPTIONS=detect_deadlocks=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-RD +// RUN: TSAN_OPTIONS=detect_deadlocks=1 %deflake %run %t | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-RD // RUN: %clangxx_tsan %s -o %t -DLockType=PthreadRecursiveMutex -// RUN: TSAN_OPTIONS=detect_deadlocks=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-REC +// RUN: TSAN_OPTIONS=detect_deadlocks=1 %deflake %run %t | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-REC #include #undef NDEBUG #include diff --git a/compiler-rt/test/tsan/deep_stack1.cc b/compiler-rt/test/tsan/deep_stack1.cc index 617f102b1e0f..1d00a0e856d5 100644 --- a/compiler-rt/test/tsan/deep_stack1.cc +++ b/compiler-rt/test/tsan/deep_stack1.cc @@ -1,5 +1,5 @@ -// RUN: %clangxx_tsan -O1 %s -o %t -DORDER1 && not %run %t 2>&1 | FileCheck %s -// RUN: %clangxx_tsan -O1 %s -o %t -DORDER2 && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t -DORDER1 && %deflake %run %t | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t -DORDER2 && %deflake %run %t | FileCheck %s #include #include #include diff --git a/compiler-rt/test/tsan/deflake.bash b/compiler-rt/test/tsan/deflake.bash new file mode 100755 index 000000000000..9731fa53e589 --- /dev/null +++ b/compiler-rt/test/tsan/deflake.bash @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +# This script is used to deflake inherently flaky tsan tests. +# It is invoked from lit tests as: +# %deflake mybinary +# which is then substituted by lit to: +# $(dirname %s)/deflake.bash mybinary +# The script runs the target program up to 10 times, +# until it fails (i.e. produces a race report). + +for i in $(seq 1 10); do + OUT=`$@ 2>&1` + if [[ $? != 0 ]]; then + echo "$OUT" + exit 0 + fi +done +exit 1 diff --git a/compiler-rt/test/tsan/fd_location.cc b/compiler-rt/test/tsan/fd_location.cc index ebe33be759ab..535329e06409 100644 --- a/compiler-rt/test/tsan/fd_location.cc +++ b/compiler-rt/test/tsan/fd_location.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include #include diff --git a/compiler-rt/test/tsan/fd_pipe_race.cc b/compiler-rt/test/tsan/fd_pipe_race.cc index 384cafa19ca1..88c4ed4aa398 100644 --- a/compiler-rt/test/tsan/fd_pipe_race.cc +++ b/compiler-rt/test/tsan/fd_pipe_race.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include #include diff --git a/compiler-rt/test/tsan/fd_stdout_race.cc b/compiler-rt/test/tsan/fd_stdout_race.cc index 47f3c6f6c1ab..d6a2c7c796f1 100644 --- a/compiler-rt/test/tsan/fd_stdout_race.cc +++ b/compiler-rt/test/tsan/fd_stdout_race.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include #include diff --git a/compiler-rt/test/tsan/free_race.c b/compiler-rt/test/tsan/free_race.c index 040f22334ea4..663d7bcf2eb9 100644 --- a/compiler-rt/test/tsan/free_race.c +++ b/compiler-rt/test/tsan/free_race.c @@ -1,5 +1,5 @@ // RUN: %clang_tsan -O1 %s -o %t -// RUN: not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-NOZUPP +// RUN: %deflake %run %t | FileCheck %s --check-prefix=CHECK-NOZUPP // RUN: TSAN_OPTIONS="suppressions=%s.supp print_suppressions=1" %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-SUPP #include diff --git a/compiler-rt/test/tsan/free_race2.c b/compiler-rt/test/tsan/free_race2.c index 2b979f311199..de6b2ae1fcbb 100644 --- a/compiler-rt/test/tsan/free_race2.c +++ b/compiler-rt/test/tsan/free_race2.c @@ -1,4 +1,4 @@ -// RUN: %clang_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clang_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include void __attribute__((noinline)) foo(int *mem) { diff --git a/compiler-rt/test/tsan/global_race.cc b/compiler-rt/test/tsan/global_race.cc index d28700cbccdd..224ab227eed9 100644 --- a/compiler-rt/test/tsan/global_race.cc +++ b/compiler-rt/test/tsan/global_race.cc @@ -1,44 +1,26 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include #include #include int GlobalData[10]; -int x; -namespace XXX { - struct YYY { - static int ZZZ[10]; - }; - int YYY::ZZZ[10]; -} void *Thread(void *a) { sleep(1); GlobalData[2] = 42; - x = 1; - XXX::YYY::ZZZ[0] = 1; return 0; } int main() { fprintf(stderr, "addr=%p\n", GlobalData); - fprintf(stderr, "addr2=%p\n", &x); - fprintf(stderr, "addr3=%p\n", XXX::YYY::ZZZ); pthread_t t; pthread_create(&t, 0, Thread, 0); GlobalData[2] = 43; - x = 0; - XXX::YYY::ZZZ[0] = 0; pthread_join(t, 0); } // CHECK: addr=[[ADDR:0x[0-9,a-f]+]] -// CHECK: addr2=[[ADDR2:0x[0-9,a-f]+]] -// CHECK: addr3=[[ADDR3:0x[0-9,a-f]+]] // CHECK: WARNING: ThreadSanitizer: data race // CHECK: Location is global 'GlobalData' of size 40 at [[ADDR]] ({{.*}}+0x{{[0-9,a-f]+}}) -// CHECK: WARNING: ThreadSanitizer: data race -// CHECK: Location is global 'x' of size 4 at [[ADDR2]] ({{.*}}+0x{{[0-9,a-f]+}}) -// CHECK: WARNING: ThreadSanitizer: data race -// CHECK: Location is global 'XXX::YYY::ZZZ' of size 40 at [[ADDR3]] ({{.*}}+0x{{[0-9,a-f]+}}) + diff --git a/compiler-rt/test/tsan/global_race2.cc b/compiler-rt/test/tsan/global_race2.cc new file mode 100644 index 000000000000..b8352ba52f8d --- /dev/null +++ b/compiler-rt/test/tsan/global_race2.cc @@ -0,0 +1,26 @@ +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s +#include +#include +#include +#include + +int x; + +void *Thread(void *a) { + sleep(1); + x = 1; + return 0; +} + +int main() { + fprintf(stderr, "addr2=%p\n", &x); + pthread_t t; + pthread_create(&t, 0, Thread, 0); + x = 0; + pthread_join(t, 0); +} + +// CHECK: addr2=[[ADDR2:0x[0-9,a-f]+]] +// CHECK: WARNING: ThreadSanitizer: data race +// CHECK: Location is global 'x' of size 4 at [[ADDR2]] ({{.*}}+0x{{[0-9,a-f]+}}) + diff --git a/compiler-rt/test/tsan/global_race3.cc b/compiler-rt/test/tsan/global_race3.cc new file mode 100644 index 000000000000..e37bf78b7d28 --- /dev/null +++ b/compiler-rt/test/tsan/global_race3.cc @@ -0,0 +1,30 @@ +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s +#include +#include +#include +#include + +namespace XXX { + struct YYY { + static int ZZZ[10]; + }; + int YYY::ZZZ[10]; +} + +void *Thread(void *a) { + sleep(1); + XXX::YYY::ZZZ[0] = 1; + return 0; +} + +int main() { + fprintf(stderr, "addr3=%p\n", XXX::YYY::ZZZ); + pthread_t t; + pthread_create(&t, 0, Thread, 0); + XXX::YYY::ZZZ[0] = 0; + pthread_join(t, 0); +} + +// CHECK: addr3=[[ADDR3:0x[0-9,a-f]+]] +// CHECK: WARNING: ThreadSanitizer: data race +// CHECK: Location is global 'XXX::YYY::ZZZ' of size 40 at [[ADDR3]] ({{.*}}+0x{{[0-9,a-f]+}}) diff --git a/compiler-rt/test/tsan/halt_on_error.cc b/compiler-rt/test/tsan/halt_on_error.cc index 4574801786de..3c55c60a457e 100644 --- a/compiler-rt/test/tsan/halt_on_error.cc +++ b/compiler-rt/test/tsan/halt_on_error.cc @@ -1,4 +1,4 @@ -// RUN: %clang_tsan -O1 %s -o %t && TSAN_OPTIONS="$TSAN_OPTIONS halt_on_error=1" not %run %t 2>&1 | FileCheck %s +// RUN: %clang_tsan -O1 %s -o %t && TSAN_OPTIONS="$TSAN_OPTIONS halt_on_error=1" %deflake %run %t | FileCheck %s #include #include #include diff --git a/compiler-rt/test/tsan/heap_race.cc b/compiler-rt/test/tsan/heap_race.cc index 63591e07b36d..c3da68f42658 100644 --- a/compiler-rt/test/tsan/heap_race.cc +++ b/compiler-rt/test/tsan/heap_race.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include #include diff --git a/compiler-rt/test/tsan/ignore_lib0.cc b/compiler-rt/test/tsan/ignore_lib0.cc index d62aa99dc6c1..fe1a35558015 100644 --- a/compiler-rt/test/tsan/ignore_lib0.cc +++ b/compiler-rt/test/tsan/ignore_lib0.cc @@ -1,7 +1,7 @@ // RUN: %clangxx_tsan -O1 %s -DLIB -fPIC -fno-sanitize=thread -shared -o %T/libignore_lib0.so // RUN: %clangxx_tsan -O1 %s -L%T -lignore_lib0 -o %t // RUN: echo running w/o suppressions: -// RUN: LD_LIBRARY_PATH=%T${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-NOSUPP +// RUN: LD_LIBRARY_PATH=%T${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} %deflake %run %t | FileCheck %s --check-prefix=CHECK-NOSUPP // RUN: echo running with suppressions: // RUN: LD_LIBRARY_PATH=%T${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} TSAN_OPTIONS="$TSAN_OPTIONS suppressions=%s.supp" %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-WITHSUPP diff --git a/compiler-rt/test/tsan/ignore_lib1.cc b/compiler-rt/test/tsan/ignore_lib1.cc index b848350d7ca5..30a9994b94f5 100644 --- a/compiler-rt/test/tsan/ignore_lib1.cc +++ b/compiler-rt/test/tsan/ignore_lib1.cc @@ -1,7 +1,7 @@ // RUN: %clangxx_tsan -O1 %s -DLIB -fPIC -fno-sanitize=thread -shared -o %T/libignore_lib1.so // RUN: %clangxx_tsan -O1 %s -o %t // RUN: echo running w/o suppressions: -// RUN: not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-NOSUPP +// RUN: %deflake %run %t | FileCheck %s --check-prefix=CHECK-NOSUPP // RUN: echo running with suppressions: // RUN: TSAN_OPTIONS="$TSAN_OPTIONS suppressions=%s.supp" %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-WITHSUPP diff --git a/compiler-rt/test/tsan/ignore_lib2.cc b/compiler-rt/test/tsan/ignore_lib2.cc index 7467ec0f2e2b..23a0872feabe 100644 --- a/compiler-rt/test/tsan/ignore_lib2.cc +++ b/compiler-rt/test/tsan/ignore_lib2.cc @@ -1,7 +1,7 @@ // RUN: %clangxx_tsan -O1 %s -DLIB -fPIC -fno-sanitize=thread -shared -o %T/libignore_lib2_0.so // RUN: %clangxx_tsan -O1 %s -DLIB -fPIC -fno-sanitize=thread -shared -o %T/libignore_lib2_1.so // RUN: %clangxx_tsan -O1 %s -o %t -// RUN: TSAN_OPTIONS="$TSAN_OPTIONS suppressions=%s.supp" not %run %t 2>&1 | FileCheck %s +// RUN: TSAN_OPTIONS="$TSAN_OPTIONS suppressions=%s.supp" %deflake %run %t | FileCheck %s // Tests that called_from_lib suppression matched against 2 libraries // causes program crash (this is not supported). diff --git a/compiler-rt/test/tsan/ignore_lib3.cc b/compiler-rt/test/tsan/ignore_lib3.cc index 6a5f5cceae4c..137109ea6cb4 100644 --- a/compiler-rt/test/tsan/ignore_lib3.cc +++ b/compiler-rt/test/tsan/ignore_lib3.cc @@ -1,6 +1,6 @@ // RUN: %clangxx_tsan -O1 %s -DLIB -fPIC -fno-sanitize=thread -shared -o %T/libignore_lib3.so // RUN: %clangxx_tsan -O1 %s -o %t -// RUN: TSAN_OPTIONS="$TSAN_OPTIONS suppressions=%s.supp" not %run %t 2>&1 | FileCheck %s +// RUN: TSAN_OPTIONS="$TSAN_OPTIONS suppressions=%s.supp" %deflake %run %t | FileCheck %s // Tests that unloading of a library matched against called_from_lib suppression // causes program crash (this is not supported). diff --git a/compiler-rt/test/tsan/ignore_sync.cc b/compiler-rt/test/tsan/ignore_sync.cc index ae6edaea0e1b..ae24a8c49e75 100644 --- a/compiler-rt/test/tsan/ignore_sync.cc +++ b/compiler-rt/test/tsan/ignore_sync.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include diff --git a/compiler-rt/test/tsan/inlined_memcpy_race.cc b/compiler-rt/test/tsan/inlined_memcpy_race.cc index 12f82d264d8a..a95576a83c9a 100644 --- a/compiler-rt/test/tsan/inlined_memcpy_race.cc +++ b/compiler-rt/test/tsan/inlined_memcpy_race.cc @@ -1,22 +1,17 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include #include #include #include -int x[4], y[4], z[4]; +int x[4], z[4]; void *MemCpyThread(void *a) { memcpy((int*)a, z, 16); return NULL; } -void *MemMoveThread(void *a) { - memmove((int*)a, z, 16); - return NULL; -} - void *MemSetThread(void *a) { sleep(1); memset((int*)a, 0, 16); @@ -30,12 +25,6 @@ int main() { pthread_create(&t[1], NULL, MemSetThread, x); pthread_join(t[0], NULL); pthread_join(t[1], NULL); - // Race on y between memmove and memset - pthread_create(&t[0], NULL, MemMoveThread, y); - pthread_create(&t[1], NULL, MemSetThread, y); - pthread_join(t[0], NULL); - pthread_join(t[1], NULL); - printf("PASS\n"); return 0; } @@ -47,9 +36,3 @@ int main() { // CHECK: #0 memcpy // CHECK: #1 MemCpyThread -// CHECK: WARNING: ThreadSanitizer: data race -// CHECK: #0 memset -// CHECK: #1 MemSetThread -// CHECK: Previous write -// CHECK: #0 memmove -// CHECK: #1 MemMoveThread diff --git a/compiler-rt/test/tsan/inlined_memcpy_race2.cc b/compiler-rt/test/tsan/inlined_memcpy_race2.cc new file mode 100644 index 000000000000..63b560f02269 --- /dev/null +++ b/compiler-rt/test/tsan/inlined_memcpy_race2.cc @@ -0,0 +1,38 @@ +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s +#include +#include +#include +#include +#include + +int y[4], z[4]; + +void *MemMoveThread(void *a) { + memmove((int*)a, z, 16); + return NULL; +} + +void *MemSetThread(void *a) { + sleep(1); + memset((int*)a, 0, 16); + return NULL; +} + +int main() { + pthread_t t[2]; + // Race on y between memmove and memset + pthread_create(&t[0], NULL, MemMoveThread, y); + pthread_create(&t[1], NULL, MemSetThread, y); + pthread_join(t[0], NULL); + pthread_join(t[1], NULL); + + printf("PASS\n"); + return 0; +} + +// CHECK: WARNING: ThreadSanitizer: data race +// CHECK: #0 memset +// CHECK: #1 MemSetThread +// CHECK: Previous write +// CHECK: #0 memmove +// CHECK: #1 MemMoveThread diff --git a/compiler-rt/test/tsan/java_lock_rec_race.cc b/compiler-rt/test/tsan/java_lock_rec_race.cc index c802b9e77807..af308d7b7f3c 100644 --- a/compiler-rt/test/tsan/java_lock_rec_race.cc +++ b/compiler-rt/test/tsan/java_lock_rec_race.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "java.h" #include diff --git a/compiler-rt/test/tsan/java_race.cc b/compiler-rt/test/tsan/java_race.cc index 27b5c7fb6e58..10aefdbaf19e 100644 --- a/compiler-rt/test/tsan/java_race.cc +++ b/compiler-rt/test/tsan/java_race.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "java.h" void *Thread(void *p) { diff --git a/compiler-rt/test/tsan/java_race_move.cc b/compiler-rt/test/tsan/java_race_move.cc index b7446665a396..45876a034024 100644 --- a/compiler-rt/test/tsan/java_race_move.cc +++ b/compiler-rt/test/tsan/java_race_move.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include "java.h" jptr varaddr; diff --git a/compiler-rt/test/tsan/lit.cfg b/compiler-rt/test/tsan/lit.cfg index 7b7c2bb71b1d..f7051b3b698b 100644 --- a/compiler-rt/test/tsan/lit.cfg +++ b/compiler-rt/test/tsan/lit.cfg @@ -57,6 +57,8 @@ config.substitutions.append( ("%clangxx_tsan ", build_invocation(clang_tsan_cxxf # Define CHECK-%os to check for OS-dependent output. config.substitutions.append( ('CHECK-%os', ("CHECK-" + config.host_os))) +config.substitutions.append( ("%deflake ", os.path.join(os.path.dirname(__file__), "deflake.bash")) ) + # Default test suffixes. config.suffixes = ['.c', '.cc', '.cpp'] diff --git a/compiler-rt/test/tsan/load_shared_lib.cc b/compiler-rt/test/tsan/load_shared_lib.cc index 2b250e3e6f38..2747b2951146 100644 --- a/compiler-rt/test/tsan/load_shared_lib.cc +++ b/compiler-rt/test/tsan/load_shared_lib.cc @@ -4,7 +4,7 @@ // RUN: %clangxx_tsan -O1 %p/SharedLibs/load_shared_lib-so.cc \ // RUN: -fPIC -shared -o %t-so.so -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include diff --git a/compiler-rt/test/tsan/longjmp3.cc b/compiler-rt/test/tsan/longjmp3.cc index afb4996d433b..71d964dbbed9 100644 --- a/compiler-rt/test/tsan/longjmp3.cc +++ b/compiler-rt/test/tsan/longjmp3.cc @@ -1,4 +1,4 @@ -// RUN: %clang_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clang_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include #include diff --git a/compiler-rt/test/tsan/longjmp4.cc b/compiler-rt/test/tsan/longjmp4.cc index 1ec3b4b7e782..15330f5d83c8 100644 --- a/compiler-rt/test/tsan/longjmp4.cc +++ b/compiler-rt/test/tsan/longjmp4.cc @@ -1,4 +1,4 @@ -// RUN: %clang_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clang_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include #include diff --git a/compiler-rt/test/tsan/malloc_hook.cc b/compiler-rt/test/tsan/malloc_hook.cc index 63e1c3cac3a0..a2658b79a7ff 100644 --- a/compiler-rt/test/tsan/malloc_hook.cc +++ b/compiler-rt/test/tsan/malloc_hook.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include #include diff --git a/compiler-rt/test/tsan/malloc_stack.cc b/compiler-rt/test/tsan/malloc_stack.cc index cea6020181ed..6027360754aa 100644 --- a/compiler-rt/test/tsan/malloc_stack.cc +++ b/compiler-rt/test/tsan/malloc_stack.cc @@ -1,4 +1,4 @@ -// RUN: %clang_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clang_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include diff --git a/compiler-rt/test/tsan/memcpy_race.cc b/compiler-rt/test/tsan/memcpy_race.cc index d7314d2557d6..8ec8e0a3e6a5 100644 --- a/compiler-rt/test/tsan/memcpy_race.cc +++ b/compiler-rt/test/tsan/memcpy_race.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include #include diff --git a/compiler-rt/test/tsan/mop_with_offset.cc b/compiler-rt/test/tsan/mop_with_offset.cc index e9342794d7df..e44c78b7d1b4 100644 --- a/compiler-rt/test/tsan/mop_with_offset.cc +++ b/compiler-rt/test/tsan/mop_with_offset.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include #include diff --git a/compiler-rt/test/tsan/mop_with_offset2.cc b/compiler-rt/test/tsan/mop_with_offset2.cc index 31b4a406d441..a465d5f09471 100644 --- a/compiler-rt/test/tsan/mop_with_offset2.cc +++ b/compiler-rt/test/tsan/mop_with_offset2.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include #include diff --git a/compiler-rt/test/tsan/mutex_bad_read_lock.cc b/compiler-rt/test/tsan/mutex_bad_read_lock.cc index c64bf8849dc1..84a2976d53e4 100644 --- a/compiler-rt/test/tsan/mutex_bad_read_lock.cc +++ b/compiler-rt/test/tsan/mutex_bad_read_lock.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s extern "C" void AnnotateRWLockAcquired(const char *f, int l, void *m, long rw); int main() { diff --git a/compiler-rt/test/tsan/mutex_bad_read_unlock.cc b/compiler-rt/test/tsan/mutex_bad_read_unlock.cc index ab417f43c466..dcee51599d55 100644 --- a/compiler-rt/test/tsan/mutex_bad_read_unlock.cc +++ b/compiler-rt/test/tsan/mutex_bad_read_unlock.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s extern "C" void AnnotateRWLockAcquired(const char *f, int l, void *m, long rw); extern "C" void AnnotateRWLockReleased(const char *f, int l, void *m, long rw); diff --git a/compiler-rt/test/tsan/mutex_bad_unlock.cc b/compiler-rt/test/tsan/mutex_bad_unlock.cc index 301903571506..6b483cf17eda 100644 --- a/compiler-rt/test/tsan/mutex_bad_unlock.cc +++ b/compiler-rt/test/tsan/mutex_bad_unlock.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s extern "C" void AnnotateRWLockReleased(const char *f, int l, void *m, long rw); int main() { diff --git a/compiler-rt/test/tsan/mutex_destroy_locked.cc b/compiler-rt/test/tsan/mutex_destroy_locked.cc index 6c5dcbf11c36..b81905ec68fd 100644 --- a/compiler-rt/test/tsan/mutex_destroy_locked.cc +++ b/compiler-rt/test/tsan/mutex_destroy_locked.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include diff --git a/compiler-rt/test/tsan/mutex_double_lock.cc b/compiler-rt/test/tsan/mutex_double_lock.cc index 551d911e6186..c1bebf73706e 100644 --- a/compiler-rt/test/tsan/mutex_double_lock.cc +++ b/compiler-rt/test/tsan/mutex_double_lock.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include diff --git a/compiler-rt/test/tsan/mutex_robust2.cc b/compiler-rt/test/tsan/mutex_robust2.cc index f3125c115d66..0914c1763604 100644 --- a/compiler-rt/test/tsan/mutex_robust2.cc +++ b/compiler-rt/test/tsan/mutex_robust2.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include #include diff --git a/compiler-rt/test/tsan/mutexset1.cc b/compiler-rt/test/tsan/mutexset1.cc index 49607d7a293f..72964edfb1e7 100644 --- a/compiler-rt/test/tsan/mutexset1.cc +++ b/compiler-rt/test/tsan/mutexset1.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include #include diff --git a/compiler-rt/test/tsan/mutexset2.cc b/compiler-rt/test/tsan/mutexset2.cc index 80b690df7b1a..01a5f5df6e94 100644 --- a/compiler-rt/test/tsan/mutexset2.cc +++ b/compiler-rt/test/tsan/mutexset2.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include #include diff --git a/compiler-rt/test/tsan/mutexset3.cc b/compiler-rt/test/tsan/mutexset3.cc index 17c27ea262c6..e14bb1111e32 100644 --- a/compiler-rt/test/tsan/mutexset3.cc +++ b/compiler-rt/test/tsan/mutexset3.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include #include diff --git a/compiler-rt/test/tsan/mutexset4.cc b/compiler-rt/test/tsan/mutexset4.cc index f56d37a73ee2..db860e005d67 100644 --- a/compiler-rt/test/tsan/mutexset4.cc +++ b/compiler-rt/test/tsan/mutexset4.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include #include diff --git a/compiler-rt/test/tsan/mutexset5.cc b/compiler-rt/test/tsan/mutexset5.cc index ea1255373c64..e1cc2fcacf62 100644 --- a/compiler-rt/test/tsan/mutexset5.cc +++ b/compiler-rt/test/tsan/mutexset5.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include #include diff --git a/compiler-rt/test/tsan/mutexset6.cc b/compiler-rt/test/tsan/mutexset6.cc index a42a743645d5..07dcc0a7394d 100644 --- a/compiler-rt/test/tsan/mutexset6.cc +++ b/compiler-rt/test/tsan/mutexset6.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include #include diff --git a/compiler-rt/test/tsan/mutexset7.cc b/compiler-rt/test/tsan/mutexset7.cc index b80eddb083cf..12174844c799 100644 --- a/compiler-rt/test/tsan/mutexset7.cc +++ b/compiler-rt/test/tsan/mutexset7.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include #include diff --git a/compiler-rt/test/tsan/mutexset8.cc b/compiler-rt/test/tsan/mutexset8.cc index 23449ab0dfba..3e1ab8c5a744 100644 --- a/compiler-rt/test/tsan/mutexset8.cc +++ b/compiler-rt/test/tsan/mutexset8.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include #include diff --git a/compiler-rt/test/tsan/pthread_atfork_deadlock.c b/compiler-rt/test/tsan/pthread_atfork_deadlock.c index 3e91f3ea5bff..965de05b43e4 100644 --- a/compiler-rt/test/tsan/pthread_atfork_deadlock.c +++ b/compiler-rt/test/tsan/pthread_atfork_deadlock.c @@ -1,4 +1,4 @@ -// RUN: %clang_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clang_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s // Regression test for // https://code.google.com/p/thread-sanitizer/issues/detail?id=61 // When the data race was reported, pthread_atfork() handler used to be diff --git a/compiler-rt/test/tsan/race_on_barrier.c b/compiler-rt/test/tsan/race_on_barrier.c index e93995ade14b..99b18fe4d8e6 100644 --- a/compiler-rt/test/tsan/race_on_barrier.c +++ b/compiler-rt/test/tsan/race_on_barrier.c @@ -1,4 +1,4 @@ -// RUN: %clang_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clang_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include #include diff --git a/compiler-rt/test/tsan/race_on_barrier2.c b/compiler-rt/test/tsan/race_on_barrier2.c index 75f9b4a092da..98c028e19fdd 100644 --- a/compiler-rt/test/tsan/race_on_barrier2.c +++ b/compiler-rt/test/tsan/race_on_barrier2.c @@ -1,4 +1,4 @@ -// RUN: %clang_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clang_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include #include diff --git a/compiler-rt/test/tsan/race_on_heap.cc b/compiler-rt/test/tsan/race_on_heap.cc index 54c4a9b02f94..a66e0c4f93f7 100644 --- a/compiler-rt/test/tsan/race_on_heap.cc +++ b/compiler-rt/test/tsan/race_on_heap.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include #include @@ -38,7 +38,7 @@ int main() { // CHECK: WARNING: ThreadSanitizer: data race // ... // CHECK: Location is heap block of size 99 at [[ADDR]] allocated by thread T1: -// CHCEKL #0 malloc +// CHCEK: #0 malloc // CHECK: #{{1|2}} alloc // CHECK: #{{2|3}} AllocThread // ... diff --git a/compiler-rt/test/tsan/race_on_mutex.c b/compiler-rt/test/tsan/race_on_mutex.c index d3e621062e73..b4adeeb4df72 100644 --- a/compiler-rt/test/tsan/race_on_mutex.c +++ b/compiler-rt/test/tsan/race_on_mutex.c @@ -1,4 +1,4 @@ -// RUN: %clang_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clang_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include #include diff --git a/compiler-rt/test/tsan/race_on_mutex2.c b/compiler-rt/test/tsan/race_on_mutex2.c index c860fc6d8eb6..1796d0c6480b 100644 --- a/compiler-rt/test/tsan/race_on_mutex2.c +++ b/compiler-rt/test/tsan/race_on_mutex2.c @@ -1,4 +1,4 @@ -// RUN: %clang_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clang_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include #include diff --git a/compiler-rt/test/tsan/race_on_read.cc b/compiler-rt/test/tsan/race_on_read.cc index 4dc976d00426..1ec0522b9035 100644 --- a/compiler-rt/test/tsan/race_on_read.cc +++ b/compiler-rt/test/tsan/race_on_read.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include #include diff --git a/compiler-rt/test/tsan/race_on_write.cc b/compiler-rt/test/tsan/race_on_write.cc index add22ce600ac..484bbb7ae022 100644 --- a/compiler-rt/test/tsan/race_on_write.cc +++ b/compiler-rt/test/tsan/race_on_write.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include #include diff --git a/compiler-rt/test/tsan/race_with_finished_thread.cc b/compiler-rt/test/tsan/race_with_finished_thread.cc index b3f9b706651f..d28760093c42 100644 --- a/compiler-rt/test/tsan/race_with_finished_thread.cc +++ b/compiler-rt/test/tsan/race_with_finished_thread.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include #include diff --git a/compiler-rt/test/tsan/signal_errno.cc b/compiler-rt/test/tsan/signal_errno.cc index 326953ea2786..27d4ecd88302 100644 --- a/compiler-rt/test/tsan/signal_errno.cc +++ b/compiler-rt/test/tsan/signal_errno.cc @@ -1,4 +1,4 @@ -// RUN: %clang_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clang_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include #include diff --git a/compiler-rt/test/tsan/signal_malloc.cc b/compiler-rt/test/tsan/signal_malloc.cc index f6fc3facb3d0..db5e79b997d8 100644 --- a/compiler-rt/test/tsan/signal_malloc.cc +++ b/compiler-rt/test/tsan/signal_malloc.cc @@ -1,4 +1,4 @@ -// RUN: %clang_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clang_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include #include diff --git a/compiler-rt/test/tsan/sigsuspend.cc b/compiler-rt/test/tsan/sigsuspend.cc index dc9606637fee..f614c12acb1e 100644 --- a/compiler-rt/test/tsan/sigsuspend.cc +++ b/compiler-rt/test/tsan/sigsuspend.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s // Always enable asserts. #ifdef NDEBUG diff --git a/compiler-rt/test/tsan/simple_race.c b/compiler-rt/test/tsan/simple_race.c index 78f105fa1745..7b60c5ec249e 100644 --- a/compiler-rt/test/tsan/simple_race.c +++ b/compiler-rt/test/tsan/simple_race.c @@ -1,4 +1,4 @@ -// RUN: %clang_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clang_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include #include @@ -26,3 +26,4 @@ int main() { } // CHECK: WARNING: ThreadSanitizer: data race + diff --git a/compiler-rt/test/tsan/simple_race.cc b/compiler-rt/test/tsan/simple_race.cc index 9010ed5f5290..0236b9f9b042 100644 --- a/compiler-rt/test/tsan/simple_race.cc +++ b/compiler-rt/test/tsan/simple_race.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t 2>&1 | FileCheck %s #include #include diff --git a/compiler-rt/test/tsan/simple_stack.c b/compiler-rt/test/tsan/simple_stack.c index f2326eb09bba..899277f4e489 100644 --- a/compiler-rt/test/tsan/simple_stack.c +++ b/compiler-rt/test/tsan/simple_stack.c @@ -1,4 +1,4 @@ -// RUN: %clang_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clang_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include #include diff --git a/compiler-rt/test/tsan/simple_stack2.cc b/compiler-rt/test/tsan/simple_stack2.cc index 080387a871ed..ba0303c1ef79 100644 --- a/compiler-rt/test/tsan/simple_stack2.cc +++ b/compiler-rt/test/tsan/simple_stack2.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include #include diff --git a/compiler-rt/test/tsan/sleep_sync.cc b/compiler-rt/test/tsan/sleep_sync.cc index 5047fdf04c9e..c7614e16bf3e 100644 --- a/compiler-rt/test/tsan/sleep_sync.cc +++ b/compiler-rt/test/tsan/sleep_sync.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include diff --git a/compiler-rt/test/tsan/sleep_sync2.cc b/compiler-rt/test/tsan/sleep_sync2.cc index 7739405254c9..4e616992ecc9 100644 --- a/compiler-rt/test/tsan/sleep_sync2.cc +++ b/compiler-rt/test/tsan/sleep_sync2.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include diff --git a/compiler-rt/test/tsan/stack_race.cc b/compiler-rt/test/tsan/stack_race.cc index 90da2f8c8270..2e02f46a281f 100644 --- a/compiler-rt/test/tsan/stack_race.cc +++ b/compiler-rt/test/tsan/stack_race.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include #include diff --git a/compiler-rt/test/tsan/stack_race2.cc b/compiler-rt/test/tsan/stack_race2.cc index 83a67f49afa7..818db367bab6 100644 --- a/compiler-rt/test/tsan/stack_race2.cc +++ b/compiler-rt/test/tsan/stack_race2.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include #include diff --git a/compiler-rt/test/tsan/static_init3.cc b/compiler-rt/test/tsan/static_init3.cc index 94934b4a9f1a..3b9fe62ae2bc 100644 --- a/compiler-rt/test/tsan/static_init3.cc +++ b/compiler-rt/test/tsan/static_init3.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include #include diff --git a/compiler-rt/test/tsan/suppress_same_address.cc b/compiler-rt/test/tsan/suppress_same_address.cc index c1721409a5e0..df19da1cc7ae 100644 --- a/compiler-rt/test/tsan/suppress_same_address.cc +++ b/compiler-rt/test/tsan/suppress_same_address.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include diff --git a/compiler-rt/test/tsan/suppress_same_stacks.cc b/compiler-rt/test/tsan/suppress_same_stacks.cc index 23008b4bb56f..9305650eaa17 100644 --- a/compiler-rt/test/tsan/suppress_same_stacks.cc +++ b/compiler-rt/test/tsan/suppress_same_stacks.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include volatile int N; // Prevent loop unrolling. diff --git a/compiler-rt/test/tsan/thread_end_with_ignore.cc b/compiler-rt/test/tsan/thread_end_with_ignore.cc index 438a738e20c4..79bb08d64bcb 100644 --- a/compiler-rt/test/tsan/thread_end_with_ignore.cc +++ b/compiler-rt/test/tsan/thread_end_with_ignore.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include diff --git a/compiler-rt/test/tsan/thread_end_with_ignore2.cc b/compiler-rt/test/tsan/thread_end_with_ignore2.cc index ca9b5ca895e1..9387ea488d5a 100644 --- a/compiler-rt/test/tsan/thread_end_with_ignore2.cc +++ b/compiler-rt/test/tsan/thread_end_with_ignore2.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s extern "C" void AnnotateIgnoreWritesBegin(const char *f, int l); int main() { diff --git a/compiler-rt/test/tsan/thread_end_with_ignore3.cc b/compiler-rt/test/tsan/thread_end_with_ignore3.cc index f066f9e1dcf6..55688b2a543f 100644 --- a/compiler-rt/test/tsan/thread_end_with_ignore3.cc +++ b/compiler-rt/test/tsan/thread_end_with_ignore3.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s extern "C" void AnnotateIgnoreReadsBegin(const char *f, int l); extern "C" void AnnotateIgnoreReadsEnd(const char *f, int l); diff --git a/compiler-rt/test/tsan/thread_leak3.c b/compiler-rt/test/tsan/thread_leak3.c index efc4dd024f9e..f4db484219a0 100644 --- a/compiler-rt/test/tsan/thread_leak3.c +++ b/compiler-rt/test/tsan/thread_leak3.c @@ -1,4 +1,4 @@ -// RUN: %clang_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clang_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include diff --git a/compiler-rt/test/tsan/thread_leak5.c b/compiler-rt/test/tsan/thread_leak5.c index 130858cfb268..ca244a9f24e1 100644 --- a/compiler-rt/test/tsan/thread_leak5.c +++ b/compiler-rt/test/tsan/thread_leak5.c @@ -1,4 +1,4 @@ -// RUN: %clang_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clang_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include diff --git a/compiler-rt/test/tsan/thread_name.cc b/compiler-rt/test/tsan/thread_name.cc index af29a2ee4d81..05b0a352a9ec 100644 --- a/compiler-rt/test/tsan/thread_name.cc +++ b/compiler-rt/test/tsan/thread_name.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include #include diff --git a/compiler-rt/test/tsan/thread_name2.cc b/compiler-rt/test/tsan/thread_name2.cc index 0530c9888f15..b9a574623e01 100644 --- a/compiler-rt/test/tsan/thread_name2.cc +++ b/compiler-rt/test/tsan/thread_name2.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include #include diff --git a/compiler-rt/test/tsan/tiny_race.c b/compiler-rt/test/tsan/tiny_race.c index 9d8422480907..c10eab15c5a9 100644 --- a/compiler-rt/test/tsan/tiny_race.c +++ b/compiler-rt/test/tsan/tiny_race.c @@ -1,4 +1,4 @@ -// RUN: %clang_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clang_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include diff --git a/compiler-rt/test/tsan/tls_race.cc b/compiler-rt/test/tsan/tls_race.cc index dbfc5531b190..18589347e806 100644 --- a/compiler-rt/test/tsan/tls_race.cc +++ b/compiler-rt/test/tsan/tls_race.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include #include diff --git a/compiler-rt/test/tsan/tls_race2.cc b/compiler-rt/test/tsan/tls_race2.cc index ed9f4d0faf38..0ca629ada5cc 100644 --- a/compiler-rt/test/tsan/tls_race2.cc +++ b/compiler-rt/test/tsan/tls_race2.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include #include diff --git a/compiler-rt/test/tsan/unaligned_race.cc b/compiler-rt/test/tsan/unaligned_race.cc index a2b267514766..6e9b5a33f0da 100644 --- a/compiler-rt/test/tsan/unaligned_race.cc +++ b/compiler-rt/test/tsan/unaligned_race.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include #include diff --git a/compiler-rt/test/tsan/vptr_harmful_race.cc b/compiler-rt/test/tsan/vptr_harmful_race.cc index c7d4b74dff24..68e12e8e7e89 100644 --- a/compiler-rt/test/tsan/vptr_harmful_race.cc +++ b/compiler-rt/test/tsan/vptr_harmful_race.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include #include diff --git a/compiler-rt/test/tsan/vptr_harmful_race2.cc b/compiler-rt/test/tsan/vptr_harmful_race2.cc index b018d5cb9950..aa53bbb90fcf 100644 --- a/compiler-rt/test/tsan/vptr_harmful_race2.cc +++ b/compiler-rt/test/tsan/vptr_harmful_race2.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include #include diff --git a/compiler-rt/test/tsan/vptr_harmful_race3.cc b/compiler-rt/test/tsan/vptr_harmful_race3.cc index 01c94e2846b3..ac6ea94e51eb 100644 --- a/compiler-rt/test/tsan/vptr_harmful_race3.cc +++ b/compiler-rt/test/tsan/vptr_harmful_race3.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include #include diff --git a/compiler-rt/test/tsan/write_in_reader_lock.cc b/compiler-rt/test/tsan/write_in_reader_lock.cc index 77373bedcc4e..55882139b153 100644 --- a/compiler-rt/test/tsan/write_in_reader_lock.cc +++ b/compiler-rt/test/tsan/write_in_reader_lock.cc @@ -1,4 +1,4 @@ -// RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s #include #include