[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
This commit is contained in:
Julian Lettner 2019-09-09 20:07:03 +00:00
parent eae609e306
commit 6d04ee0f86
6 changed files with 5 additions and 31 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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) {

View File

@ -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__);

View File

@ -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.

View File

@ -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