From 49a040a483e6afa9ff536320f4f5afc7cd2fd6af Mon Sep 17 00:00:00 2001 From: Alexey Samsonov Date: Mon, 24 Nov 2014 22:27:34 +0000 Subject: [PATCH] [TSan] Deflake test llvm-svn: 222699 --- compiler-rt/test/tsan/simple_race.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compiler-rt/test/tsan/simple_race.cc b/compiler-rt/test/tsan/simple_race.cc index 0236b9f..f711bb5 100644 --- a/compiler-rt/test/tsan/simple_race.cc +++ b/compiler-rt/test/tsan/simple_race.cc @@ -1,10 +1,12 @@ // RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t 2>&1 | FileCheck %s #include #include +#include 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 -- 2.7.4