summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulian Lettner <jlettner@apple.com>2019-09-09 20:07:03 +0000
committerJulian Lettner <jlettner@apple.com>2019-09-09 20:07:03 +0000
commit6d04ee0f86382a7af9a1063b5d47d146e5c70dda (patch)
tree3925ce96a323539190f054b24d69482b2ad9931c
parenteae609e306e87cbc821265dfc9c6537813ced84c (diff)
downloadbcm5719-llvm-6d04ee0f86382a7af9a1063b5d47d146e5c70dda.tar.gz
bcm5719-llvm-6d04ee0f86382a7af9a1063b5d47d146e5c70dda.zip
[TSan] Add AnnotateIgnoreReadsBegin declaration to tsan/test.h
Declare the family of AnnotateIgnore[Read,Write][Begin,End] TSan annotations in compiler-rt/test/tsan/test.h so that we don't have to declare them separately in every test that needs them. Replace usages. Leave usages that explicitly test the annotation mechanism: thread_end_with_ignore.cpp thread_end_with_ignore3.cpp llvm-svn: 371446
-rw-r--r--compiler-rt/test/tsan/Darwin/mach_vm_allocate.c5
-rw-r--r--compiler-rt/test/tsan/ignore_free.cpp7
-rw-r--r--compiler-rt/test/tsan/ignore_malloc.cpp7
-rw-r--r--compiler-rt/test/tsan/ignore_race.cpp5
-rw-r--r--compiler-rt/test/tsan/ignored-interceptors-mmap.cpp7
-rw-r--r--compiler-rt/test/tsan/test.h5
6 files changed, 5 insertions, 31 deletions
diff --git a/compiler-rt/test/tsan/Darwin/mach_vm_allocate.c b/compiler-rt/test/tsan/Darwin/mach_vm_allocate.c
index df3cdec71e7..5b1235201bd 100644
--- a/compiler-rt/test/tsan/Darwin/mach_vm_allocate.c
+++ b/compiler-rt/test/tsan/Darwin/mach_vm_allocate.c
@@ -11,11 +11,6 @@
#include "../test.h"
-void AnnotateIgnoreReadsBegin(const char *f, int l);
-void AnnotateIgnoreReadsEnd(const char *f, int l);
-void AnnotateIgnoreWritesBegin(const char *f, int l);
-void AnnotateIgnoreWritesEnd(const char *f, int l);
-
static int *global_ptr;
const mach_vm_size_t alloc_size = sizeof(int);
diff --git a/compiler-rt/test/tsan/ignore_free.cpp b/compiler-rt/test/tsan/ignore_free.cpp
index 4e678952c7a..51037b14d94 100644
--- a/compiler-rt/test/tsan/ignore_free.cpp
+++ b/compiler-rt/test/tsan/ignore_free.cpp
@@ -1,13 +1,6 @@
// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
#include "test.h"
-extern "C" {
-void AnnotateIgnoreReadsBegin(const char *f, int l);
-void AnnotateIgnoreReadsEnd(const char *f, int l);
-void AnnotateIgnoreWritesBegin(const char *f, int l);
-void AnnotateIgnoreWritesEnd(const char *f, int l);
-}
-
void *Thread(void *p) {
*(int*)p = 42;
barrier_wait(&barrier);
diff --git a/compiler-rt/test/tsan/ignore_malloc.cpp b/compiler-rt/test/tsan/ignore_malloc.cpp
index 100b4e5dc80..6f293e3daa5 100644
--- a/compiler-rt/test/tsan/ignore_malloc.cpp
+++ b/compiler-rt/test/tsan/ignore_malloc.cpp
@@ -1,13 +1,6 @@
// RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
#include "test.h"
-extern "C" {
-void AnnotateIgnoreReadsBegin(const char *f, int l);
-void AnnotateIgnoreReadsEnd(const char *f, int l);
-void AnnotateIgnoreWritesBegin(const char *f, int l);
-void AnnotateIgnoreWritesEnd(const char *f, int l);
-}
-
int *g;
void *Thread(void *a) {
diff --git a/compiler-rt/test/tsan/ignore_race.cpp b/compiler-rt/test/tsan/ignore_race.cpp
index e410006ddc7..ecbc4c0beab 100644
--- a/compiler-rt/test/tsan/ignore_race.cpp
+++ b/compiler-rt/test/tsan/ignore_race.cpp
@@ -3,11 +3,6 @@
int Global;
-extern "C" void AnnotateIgnoreWritesBegin(const char *f, int l);
-extern "C" void AnnotateIgnoreWritesEnd(const char *f, int l);
-extern "C" void AnnotateIgnoreReadsBegin(const char *f, int l);
-extern "C" void AnnotateIgnoreReadsEnd(const char *f, int l);
-
void *Thread(void *x) {
AnnotateIgnoreWritesBegin(__FILE__, __LINE__);
AnnotateIgnoreReadsBegin(__FILE__, __LINE__);
diff --git a/compiler-rt/test/tsan/ignored-interceptors-mmap.cpp b/compiler-rt/test/tsan/ignored-interceptors-mmap.cpp
index bcfafa40991..c2116130b08 100644
--- a/compiler-rt/test/tsan/ignored-interceptors-mmap.cpp
+++ b/compiler-rt/test/tsan/ignored-interceptors-mmap.cpp
@@ -10,13 +10,6 @@
#include "test.h"
-extern "C" {
-void AnnotateIgnoreReadsBegin(const char *f, int l);
-void AnnotateIgnoreReadsEnd(const char *f, int l);
-void AnnotateIgnoreWritesBegin(const char *f, int l);
-void AnnotateIgnoreWritesEnd(const char *f, int l);
-}
-
// Use atomic to ensure we do not have a race for the pointer value itself. We
// only want to check races in the mmap'd memory to isolate the test that mmap
// respects ignore annotations.
diff --git a/compiler-rt/test/tsan/test.h b/compiler-rt/test/tsan/test.h
index af2e6f07471..4c75572da8f 100644
--- a/compiler-rt/test/tsan/test.h
+++ b/compiler-rt/test/tsan/test.h
@@ -75,6 +75,11 @@ void AnnotateRWLockDestroy(const char *f, int l, void *m);
void AnnotateRWLockAcquired(const char *f, int l, void *m, long is_w);
void AnnotateRWLockReleased(const char *f, int l, void *m, long is_w);
+void AnnotateIgnoreReadsBegin(const char *f, int l);
+void AnnotateIgnoreReadsEnd(const char *f, int l);
+void AnnotateIgnoreWritesBegin(const char *f, int l);
+void AnnotateIgnoreWritesEnd(const char *f, int l);
+
#ifdef __cplusplus
}
#endif
OpenPOWER on IntegriCloud