[compiler-rt] r178011 - [tsan] make memcpy_race.cc test immune to memcpy inlining
Kostya Serebryany
kcc at google.com
Tue Mar 26 05:42:18 PDT 2013
Author: kcc
Date: Tue Mar 26 07:42:18 2013
New Revision: 178011
URL: http://llvm.org/viewvc/llvm-project?rev=178011&view=rev
Log:
[tsan] make memcpy_race.cc test immune to memcpy inlining
Modified:
compiler-rt/trunk/lib/tsan/lit_tests/memcpy_race.cc
Modified: compiler-rt/trunk/lib/tsan/lit_tests/memcpy_race.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/lit_tests/memcpy_race.cc?rev=178011&r1=178010&r2=178011&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/lit_tests/memcpy_race.cc (original)
+++ compiler-rt/trunk/lib/tsan/lit_tests/memcpy_race.cc Tue Mar 26 07:42:18 2013
@@ -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;
}
More information about the llvm-commits
mailing list