tsan: make positive tests more robust
authorDmitry Vyukov <dvyukov@google.com>
Fri, 30 May 2014 14:08:51 +0000 (14:08 +0000)
committerDmitry Vyukov <dvyukov@google.com>
Fri, 30 May 2014 14:08:51 +0000 (14:08 +0000)
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

89 files changed:
compiler-rt/test/tsan/atomic_free.cc
compiler-rt/test/tsan/atomic_free2.cc
compiler-rt/test/tsan/atomic_race.cc
compiler-rt/test/tsan/atomic_stack.cc
compiler-rt/test/tsan/cond_race.cc
compiler-rt/test/tsan/deadlock_detector_stress_test.cc
compiler-rt/test/tsan/deep_stack1.cc
compiler-rt/test/tsan/deflake.bash [new file with mode: 0755]
compiler-rt/test/tsan/fd_location.cc
compiler-rt/test/tsan/fd_pipe_race.cc
compiler-rt/test/tsan/fd_stdout_race.cc
compiler-rt/test/tsan/free_race.c
compiler-rt/test/tsan/free_race2.c
compiler-rt/test/tsan/global_race.cc
compiler-rt/test/tsan/global_race2.cc [new file with mode: 0644]
compiler-rt/test/tsan/global_race3.cc [new file with mode: 0644]
compiler-rt/test/tsan/halt_on_error.cc
compiler-rt/test/tsan/heap_race.cc
compiler-rt/test/tsan/ignore_lib0.cc
compiler-rt/test/tsan/ignore_lib1.cc
compiler-rt/test/tsan/ignore_lib2.cc
compiler-rt/test/tsan/ignore_lib3.cc
compiler-rt/test/tsan/ignore_sync.cc
compiler-rt/test/tsan/inlined_memcpy_race.cc
compiler-rt/test/tsan/inlined_memcpy_race2.cc [new file with mode: 0644]
compiler-rt/test/tsan/java_lock_rec_race.cc
compiler-rt/test/tsan/java_race.cc
compiler-rt/test/tsan/java_race_move.cc
compiler-rt/test/tsan/lit.cfg
compiler-rt/test/tsan/load_shared_lib.cc
compiler-rt/test/tsan/longjmp3.cc
compiler-rt/test/tsan/longjmp4.cc
compiler-rt/test/tsan/malloc_hook.cc
compiler-rt/test/tsan/malloc_stack.cc
compiler-rt/test/tsan/memcpy_race.cc
compiler-rt/test/tsan/mop_with_offset.cc
compiler-rt/test/tsan/mop_with_offset2.cc
compiler-rt/test/tsan/mutex_bad_read_lock.cc
compiler-rt/test/tsan/mutex_bad_read_unlock.cc
compiler-rt/test/tsan/mutex_bad_unlock.cc
compiler-rt/test/tsan/mutex_destroy_locked.cc
compiler-rt/test/tsan/mutex_double_lock.cc
compiler-rt/test/tsan/mutex_robust2.cc
compiler-rt/test/tsan/mutexset1.cc
compiler-rt/test/tsan/mutexset2.cc
compiler-rt/test/tsan/mutexset3.cc
compiler-rt/test/tsan/mutexset4.cc
compiler-rt/test/tsan/mutexset5.cc
compiler-rt/test/tsan/mutexset6.cc
compiler-rt/test/tsan/mutexset7.cc
compiler-rt/test/tsan/mutexset8.cc
compiler-rt/test/tsan/pthread_atfork_deadlock.c
compiler-rt/test/tsan/race_on_barrier.c
compiler-rt/test/tsan/race_on_barrier2.c
compiler-rt/test/tsan/race_on_heap.cc
compiler-rt/test/tsan/race_on_mutex.c
compiler-rt/test/tsan/race_on_mutex2.c
compiler-rt/test/tsan/race_on_read.cc
compiler-rt/test/tsan/race_on_write.cc
compiler-rt/test/tsan/race_with_finished_thread.cc
compiler-rt/test/tsan/signal_errno.cc
compiler-rt/test/tsan/signal_malloc.cc
compiler-rt/test/tsan/sigsuspend.cc
compiler-rt/test/tsan/simple_race.c
compiler-rt/test/tsan/simple_race.cc
compiler-rt/test/tsan/simple_stack.c
compiler-rt/test/tsan/simple_stack2.cc
compiler-rt/test/tsan/sleep_sync.cc
compiler-rt/test/tsan/sleep_sync2.cc
compiler-rt/test/tsan/stack_race.cc
compiler-rt/test/tsan/stack_race2.cc
compiler-rt/test/tsan/static_init3.cc
compiler-rt/test/tsan/suppress_same_address.cc
compiler-rt/test/tsan/suppress_same_stacks.cc
compiler-rt/test/tsan/thread_end_with_ignore.cc
compiler-rt/test/tsan/thread_end_with_ignore2.cc
compiler-rt/test/tsan/thread_end_with_ignore3.cc
compiler-rt/test/tsan/thread_leak3.c
compiler-rt/test/tsan/thread_leak5.c
compiler-rt/test/tsan/thread_name.cc
compiler-rt/test/tsan/thread_name2.cc
compiler-rt/test/tsan/tiny_race.c
compiler-rt/test/tsan/tls_race.cc
compiler-rt/test/tsan/tls_race2.cc
compiler-rt/test/tsan/unaligned_race.cc
compiler-rt/test/tsan/vptr_harmful_race.cc
compiler-rt/test/tsan/vptr_harmful_race2.cc
compiler-rt/test/tsan/vptr_harmful_race3.cc
compiler-rt/test/tsan/write_in_reader_lock.cc

index c36b8fb..1dcf887 100644 (file)
@@ -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 <pthread.h>
 #include <unistd.h>
 
index 11204ba..c50be6b 100644 (file)
@@ -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 <pthread.h>
 #include <unistd.h>
 
index e64ef96..ca444b4 100644 (file)
@@ -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 <pthread.h>
 #include <unistd.h>
 #include <stdio.h>
index d28b5b9..7e3176f 100644 (file)
@@ -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 <pthread.h>
 #include <unistd.h>
 
index 375bd92..fa42faf 100644 (file)
@@ -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
index ac9fcbd..5362478 100644 (file)
@@ -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 <pthread.h>
 #undef NDEBUG
 #include <assert.h>
index 617f102..1d00a0e 100644 (file)
@@ -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 <pthread.h>
 #include <stdio.h>
 #include <unistd.h>
diff --git a/compiler-rt/test/tsan/deflake.bash b/compiler-rt/test/tsan/deflake.bash
new file mode 100755 (executable)
index 0000000..9731fa5
--- /dev/null
@@ -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
index ebe33be..535329e 100644 (file)
@@ -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 <pthread.h>
 #include <stdio.h>
 #include <unistd.h>
index 384cafa..88c4ed4 100644 (file)
@@ -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 <pthread.h>
 #include <stdio.h>
 #include <unistd.h>
index 47f3c6f..d6a2c7c 100644 (file)
@@ -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 <pthread.h>
 #include <stdio.h>
 #include <unistd.h>
index 040f223..663d7bc 100644 (file)
@@ -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 <pthread.h>
index 2b979f3..de6b2ae 100644 (file)
@@ -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 <stdlib.h>
 
 void __attribute__((noinline)) foo(int *mem) {
index d28700c..224ab22 100644 (file)
@@ -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 <pthread.h>
 #include <stdio.h>
 #include <stddef.h>
 #include <unistd.h>
 
 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 (file)
index 0000000..b8352ba
--- /dev/null
@@ -0,0 +1,26 @@
+// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
+#include <pthread.h>
+#include <stdio.h>
+#include <stddef.h>
+#include <unistd.h>
+
+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 (file)
index 0000000..e37bf78
--- /dev/null
@@ -0,0 +1,30 @@
+// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
+#include <pthread.h>
+#include <stdio.h>
+#include <stddef.h>
+#include <unistd.h>
+
+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]+}})
index 4574801..3c55c60 100644 (file)
@@ -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 <pthread.h>
 #include <stdio.h>
 #include <unistd.h>
index 63591e0..c3da68f 100644 (file)
@@ -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 <pthread.h>
 #include <stdio.h>
 #include <stddef.h>
index d62aa99..fe1a355 100644 (file)
@@ -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
 
index b848350..30a9994 100644 (file)
@@ -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
 
index 7467ec0..23a0872 100644 (file)
@@ -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).
index 6a5f5cc..137109e 100644 (file)
@@ -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).
index ae6edae..ae24a8c 100644 (file)
@@ -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 <pthread.h>
 #include <stdio.h>
 
index 12f82d2..a95576a 100644 (file)
@@ -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 <pthread.h>
 #include <stddef.h>
 #include <stdio.h>
 #include <string.h>
 #include <unistd.h>
 
-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 (file)
index 0000000..63b560f
--- /dev/null
@@ -0,0 +1,38 @@
+// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
+#include <pthread.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+
+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
index c802b9e..af308d7 100644 (file)
@@ -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 <unistd.h>
 
index 27b5c7f..10aefdb 100644 (file)
@@ -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) {
index b744666..45876a0 100644 (file)
@@ -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;
index 7b7c2bb..f7051b3 100644 (file)
@@ -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']
 
index 2b250e3..2747b29 100644 (file)
@@ -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 <dlfcn.h>
 #include <pthread.h>
index afb4996..71d964d 100644 (file)
@@ -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 <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
index 1ec3b4b..15330f5 100644 (file)
@@ -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 <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
index 63e1c3c..a2658b7 100644 (file)
@@ -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 <pthread.h>
 #include <unistd.h>
 #include <stdio.h>
index cea6020..6027360 100644 (file)
@@ -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 <pthread.h>
 #include <unistd.h>
 
index d7314d2..8ec8e0a 100644 (file)
@@ -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 <pthread.h>
 #include <stddef.h>
 #include <stdio.h>
index e934279..e44c78b 100644 (file)
@@ -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 <pthread.h>
 #include <stddef.h>
 #include <stdio.h>
index 31b4a40..a465d5f 100644 (file)
@@ -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 <pthread.h>
 #include <stddef.h>
 #include <stdio.h>
index c64bf88..84a2976 100644 (file)
@@ -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() {
index ab417f4..dcee515 100644 (file)
@@ -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);
 
index 3019035..6b483cf 100644 (file)
@@ -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() {
index 6c5dcbf..b81905e 100644 (file)
@@ -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 <pthread.h>
 #include <unistd.h>
 
index 551d911..c1bebf7 100644 (file)
@@ -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 <pthread.h>
 #include <unistd.h>
 
index f3125c1..0914c17 100644 (file)
@@ -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 <pthread.h>
 #include <stdlib.h>
 #include <stdio.h>
index 49607d7..72964ed 100644 (file)
@@ -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 <pthread.h>
 #include <stdio.h>
 #include <unistd.h>
index 80b690d..01a5f5d 100644 (file)
@@ -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 <pthread.h>
 #include <stdio.h>
 #include <unistd.h>
index 17c27ea..e14bb11 100644 (file)
@@ -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 <pthread.h>
 #include <stdio.h>
 #include <unistd.h>
index f56d37a..db860e0 100644 (file)
@@ -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 <pthread.h>
 #include <stdio.h>
 #include <unistd.h>
index ea12553..e1cc2fc 100644 (file)
@@ -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 <pthread.h>
 #include <stdio.h>
 #include <unistd.h>
index a42a743..07dcc0a 100644 (file)
@@ -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 <pthread.h>
 #include <stdio.h>
 #include <unistd.h>
index b80eddb..1217484 100644 (file)
@@ -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 <pthread.h>
 #include <stdio.h>
 #include <unistd.h>
index 23449ab..3e1ab8c 100644 (file)
@@ -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 <pthread.h>
 #include <stdio.h>
 #include <unistd.h>
index 3e91f3e..965de05 100644 (file)
@@ -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
index e93995a..99b18fe 100644 (file)
@@ -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 <pthread.h>
 #include <stdio.h>
 #include <stddef.h>
index 75f9b4a..98c028e 100644 (file)
@@ -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 <pthread.h>
 #include <stdio.h>
 #include <stddef.h>
index 54c4a9b..a66e0c4 100644 (file)
@@ -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 <pthread.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -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
 // ...
index d3e6210..b4adeeb 100644 (file)
@@ -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 <pthread.h>
 #include <stdio.h>
 #include <stddef.h>
index c860fc6..1796d0c 100644 (file)
@@ -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 <pthread.h>
 #include <stdio.h>
 #include <stddef.h>
index 4dc976d..1ec0522 100644 (file)
@@ -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 <pthread.h>
 #include <stdio.h>
 #include <unistd.h>
index add22ce..484bbb7 100644 (file)
@@ -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 <pthread.h>
 #include <stdio.h>
 #include <unistd.h>
index b3f9b70..d287600 100644 (file)
@@ -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 <pthread.h>
 #include <stddef.h>
 #include <stdio.h>
index 326953e..27d4ecd 100644 (file)
@@ -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 <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
index f6fc3fa..db5e79b 100644 (file)
@@ -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 <stdio.h>
 #include <stdlib.h>
 #include <signal.h>
index dc96066..f614c12 100644 (file)
@@ -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
index 78f105f..7b60c5e 100644 (file)
@@ -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 <pthread.h>
 #include <stdio.h>
 #include <unistd.h>
@@ -26,3 +26,4 @@ int main() {
 }
 
 // CHECK: WARNING: ThreadSanitizer: data race
+
index 9010ed5..0236b9f 100644 (file)
@@ -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 <pthread.h>
 #include <stdio.h>
 
index f2326eb..899277f 100644 (file)
@@ -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 <pthread.h>
 #include <stdio.h>
 #include <unistd.h>
index 080387a..ba0303c 100644 (file)
@@ -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 <pthread.h>
 #include <stdio.h>
 #include <unistd.h>
index 5047fdf..c7614e1 100644 (file)
@@ -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 <pthread.h>
 #include <unistd.h>
 
index 7739405..4e61699 100644 (file)
@@ -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 <pthread.h>
 #include <unistd.h>
 
index 90da2f8..2e02f46 100644 (file)
@@ -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 <pthread.h>
 #include <stddef.h>
 #include <unistd.h>
index 83a67f4..818db36 100644 (file)
@@ -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 <pthread.h>
 #include <stddef.h>
 #include <unistd.h>
index 94934b4..3b9fe62 100644 (file)
@@ -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 <pthread.h>
 #include <stdlib.h>
 #include <stdio.h>
index c172140..df19da1 100644 (file)
@@ -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 <pthread.h>
 #include <unistd.h>
 
index 23008b4..9305650 100644 (file)
@@ -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 <pthread.h>
 
 volatile int N;  // Prevent loop unrolling.
index 438a738..79bb08d 100644 (file)
@@ -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 <pthread.h>
 #include <stdio.h>
 
index ca9b5ca..9387ea4 100644 (file)
@@ -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() {
index f066f9e..55688b2 100644 (file)
@@ -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);
 
index efc4dd0..f4db484 100644 (file)
@@ -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 <pthread.h>
 #include <unistd.h>
 
index 130858c..ca244a9 100644 (file)
@@ -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 <pthread.h>
 #include <unistd.h>
 
index af29a2e..05b0a35 100644 (file)
@@ -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 <pthread.h>
 #include <stdio.h>
 #include <unistd.h>
index 0530c98..b9a5746 100644 (file)
@@ -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 <pthread.h>
 #include <stdio.h>
 #include <unistd.h>
index 9d84224..c10eab1 100644 (file)
@@ -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 <pthread.h>
 #include <unistd.h>
 
index dbfc553..1858934 100644 (file)
@@ -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 <pthread.h>
 #include <stddef.h>
 #include <unistd.h>
index ed9f4d0..0ca629a 100644 (file)
@@ -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 <pthread.h>
 #include <stddef.h>
 #include <unistd.h>
index a2b2675..6e9b5a3 100644 (file)
@@ -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 <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
index c7d4b74..68e12e8 100644 (file)
@@ -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 <pthread.h>
 #include <semaphore.h>
 #include <stdio.h>
index b018d5c..aa53bbb 100644 (file)
@@ -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 <pthread.h>
 #include <semaphore.h>
 #include <stdio.h>
index 01c94e2..ac6ea94 100644 (file)
@@ -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 <pthread.h>
 #include <semaphore.h>
 #include <stdio.h>
index 77373be..5588213 100644 (file)
@@ -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 <pthread.h>
 #include <unistd.h>