From: Dmitry Vyukov Date: Fri, 30 May 2014 14:08:51 +0000 (+0000) Subject: tsan: make positive tests more robust X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=233f401c2bf247d9764c3ca641513dafb623e00c;p=platform%2Fupstream%2Fllvm.git tsan: make positive tests more robust Add a script that is used to deflake inherently flaky tsan tests. It is invoked from lit tests as: %deflake %run %t The script runs the target program up to 10 times, until it produces a tsan warning. llvm-svn: 209898 --- diff --git a/compiler-rt/test/tsan/atomic_free.cc b/compiler-rt/test/tsan/atomic_free.cc index c36b8fb..1dcf887 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 11204ba..c50be6b 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 e64ef96..ca444b4 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 d28b5b9..7e3176f 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 375bd92..fa42faf 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 ac9fcbd..5362478 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 617f102..1d00a0e 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 0000000..9731fa5 --- /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 ebe33be..535329e 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 384cafa..88c4ed4 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 47f3c6f..d6a2c7c 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 040f223..663d7bc 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 2b979f3..de6b2ae 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 d28700c..224ab22 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 0000000..b8352ba --- /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 0000000..e37bf78 --- /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 4574801..3c55c60 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 63591e07..c3da68f 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 d62aa99..fe1a355 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 b848350..30a9994 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 7467ec0..23a0872 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 6a5f5cc..137109e 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 ae6edae..ae24a8c 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 12f82d2..a95576a 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 0000000..63b560f --- /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 c802b9e..af308d7 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 27b5c7f..10aefdb 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 b744666..45876a0 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 7b7c2bb..f7051b3 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 2b250e3..2747b29 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 afb4996..71d964d 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 1ec3b4b..15330f5 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 63e1c3c..a2658b7 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 cea6020..6027360 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 d7314d2..8ec8e0a 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 e934279..e44c78b 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 31b4a40..a465d5f 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 c64bf88..84a2976 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 ab417f4..dcee515 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 3019035..6b483cf 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 6c5dcbf..b81905e 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 551d911..c1bebf7 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 f3125c1..0914c17 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 49607d7..72964ed 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 80b690d..01a5f5d 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 17c27ea..e14bb11 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 f56d37a..db860e0 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 ea12553..e1cc2fc 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 a42a743..07dcc0a 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 b80eddb..1217484 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 23449ab..3e1ab8c 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 3e91f3e..965de05 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 e93995a..99b18fe 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 75f9b4a..98c028e 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 54c4a9b..a66e0c4 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 d3e6210..b4adeeb 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 c860fc6..1796d0c 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 4dc976d..1ec0522 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 add22ce..484bbb7 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 b3f9b70..d287600 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 326953e..27d4ecd8 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 f6fc3fa..db5e79b 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 dc96066..f614c12 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 78f105f..7b60c5e 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 9010ed5..0236b9f 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 f2326eb..899277f 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 080387a..ba0303c 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 5047fdf..c7614e1 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 7739405..4e61699 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 90da2f8..2e02f46 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 83a67f4..818db36 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 94934b4..3b9fe62 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 c172140..df19da1 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 23008b4..9305650 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 438a738..79bb08d 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 ca9b5ca..9387ea4 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 f066f9e..55688b2 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 efc4dd02..f4db484 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 130858c..ca244a9 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 af29a2e..05b0a35 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 0530c98..b9a5746 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 9d84224..c10eab1 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 dbfc553..1858934 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 ed9f4d0..0ca629a 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 a2b2675..6e9b5a3 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 c7d4b74..68e12e8 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 b018d5c..aa53bbb 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 01c94e2..ac6ea94 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 77373be..5588213 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