[compiler-rt] r311776 - tsan: fix darwin build

Dmitry Vyukov via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 25 08:18:48 PDT 2017


Author: dvyukov
Date: Fri Aug 25 08:18:48 2017
New Revision: 311776

URL: http://llvm.org/viewvc/llvm-project?rev=311776&view=rev
Log:
tsan: fix darwin build

Runtime hooks do not seem to work on darwin. The test failed on builder:
http://lab.llvm.org:8080/green/job/clang-stage1-configure-RA_check/34882/consoleFull#7286766538254eaf0-7326-4999-85b0-388101f2d404
Move the test to Linux dir.


Added:
    compiler-rt/trunk/test/tsan/Linux/double_race.cc
      - copied, changed from r311775, compiler-rt/trunk/test/tsan/double_race.cc
Removed:
    compiler-rt/trunk/test/tsan/double_race.cc

Copied: compiler-rt/trunk/test/tsan/Linux/double_race.cc (from r311775, compiler-rt/trunk/test/tsan/double_race.cc)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/Linux/double_race.cc?p2=compiler-rt/trunk/test/tsan/Linux/double_race.cc&p1=compiler-rt/trunk/test/tsan/double_race.cc&r1=311775&r2=311776&rev=311776&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/double_race.cc (original)
+++ compiler-rt/trunk/test/tsan/Linux/double_race.cc Fri Aug 25 08:18:48 2017
@@ -1,5 +1,5 @@
 // RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t 2>&1 | FileCheck %s
-#include "test.h"
+#include "../test.h"
 #include <memory.h>
 
 // A reproducer for a known issue.

Removed: compiler-rt/trunk/test/tsan/double_race.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/double_race.cc?rev=311775&view=auto
==============================================================================
--- compiler-rt/trunk/test/tsan/double_race.cc (original)
+++ compiler-rt/trunk/test/tsan/double_race.cc (removed)
@@ -1,52 +0,0 @@
-// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t 2>&1 | FileCheck %s
-#include "test.h"
-#include <memory.h>
-
-// A reproducer for a known issue.
-// See reference to double_race.cc in tsan_rtl_report.cc for an explanation.
-
-char buf[16];
-volatile int nreport;
-
-void __sanitizer_report_error_summary(const char *summary) {
-  nreport++;
-}
-
-const int kEventPCBits = 61;
-
-extern "C" bool __tsan_symbolize_external(unsigned long pc, char *func_buf,
-                                          unsigned long func_siz,
-                                          char *file_buf,
-                                          unsigned long file_siz, int *line,
-                                          int *col) {
-  if (pc >> kEventPCBits) {
-    printf("bad PC passed to __tsan_symbolize_external: %lx\n", pc);
-    _exit(1);
-  }
-  return true;
-}
-
-void *Thread(void *arg) {
-  barrier_wait(&barrier);
-  memset(buf, 2, sizeof(buf));
-  return 0;
-}
-
-int main() {
-  barrier_init(&barrier, 2);
-  pthread_t t;
-  pthread_create(&t, 0, Thread, 0);
-  memset(buf, 1, sizeof(buf));
-  barrier_wait(&barrier);
-  pthread_join(t, 0);
-  return 0;
-}
-
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK:   Write of size 8 at {{.*}} by thread T1:
-// CHECK:     #0 memset
-// CHECK:     #1 Thread
-// CHECK-NOT: bad PC passed to __tsan_symbolize_external
-// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK:   Write of size 8 at {{.*}} by thread T1:
-// CHECK:     #0 Thread




More information about the llvm-commits mailing list