[tsan] make memcpy_race.cc test immune to memcpy inlining
llvm-svn: 178011
This commit is contained in:
parent
6f4b34bcf4
commit
79a6e189b0
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue