[compiler-rt] r222699 - [TSan] Deflake test

Alexey Samsonov vonosmas at gmail.com
Mon Nov 24 14:27:34 PST 2014


Author: samsonov
Date: Mon Nov 24 16:27:34 2014
New Revision: 222699

URL: http://llvm.org/viewvc/llvm-project?rev=222699&view=rev
Log:
[TSan] Deflake test

Modified:
    compiler-rt/trunk/test/tsan/simple_race.cc

Modified: compiler-rt/trunk/test/tsan/simple_race.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/simple_race.cc?rev=222699&r1=222698&r2=222699&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/simple_race.cc (original)
+++ compiler-rt/trunk/test/tsan/simple_race.cc Mon Nov 24 16:27:34 2014
@@ -1,10 +1,12 @@
 // RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t 2>&1 | FileCheck %s
 #include <pthread.h>
 #include <stdio.h>
+#include <unistd.h>
 
 int Global;
 
 void *Thread1(void *x) {
+  sleep(1);
   Global++;
   return NULL;
 }
@@ -20,6 +22,7 @@ int main() {
   pthread_create(&t[1], NULL, Thread2, NULL);
   pthread_join(t[0], NULL);
   pthread_join(t[1], NULL);
+  return 0;
 }
 
 // CHECK: WARNING: ThreadSanitizer: data race





More information about the llvm-commits mailing list