[tsan] make memcpy_race.cc test immune to memcpy inlining

llvm-svn: 178011
This commit is contained in:
Kostya Serebryany 2013-03-26 12:42:18 +00:00
parent 6f4b34bcf4
commit 79a6e189b0
1 changed files with 4 additions and 2 deletions

View File

@ -10,13 +10,15 @@ char *data1 = new char[10];
char *data2 = new char[10];
void *Thread1(void *x) {
memcpy(data+5, data1, 1);
static volatile int size = 1;
memcpy(data+5, data1, size);
return NULL;
}
void *Thread2(void *x) {
static volatile int size = 4;
sleep(1);
memcpy(data+3, data2, 4);
memcpy(data+3, data2, size);
return NULL;
}