[Tsan] Fix the global_race tests to pass on FreeBSD

Differential Revision: http://reviews.llvm.org/D5668

llvm-svn: 219398
This commit is contained in:
Viktor Kutuzov 2014-10-09 09:35:25 +00:00
parent 27781f993d
commit c2e274dc2c
3 changed files with 9 additions and 3 deletions

View File

@ -13,7 +13,9 @@ void *Thread(void *a) {
}
int main() {
fprintf(stderr, "addr=%p\n", GlobalData);
// On FreeBSD, the %p conversion specifier works as 0x%x and thus does not
// match to the format used in the diagnotic message.
fprintf(stderr, "addr=0x%012lx\n", (unsigned long) GlobalData);
pthread_t t;
pthread_create(&t, 0, Thread, 0);
GlobalData[2] = 43;

View File

@ -13,7 +13,9 @@ void *Thread(void *a) {
}
int main() {
fprintf(stderr, "addr2=%p\n", &x);
// On FreeBSD, the %p conversion specifier works as 0x%x and thus does not
// match to the format used in the diagnotic message.
fprintf(stderr, "addr2=0x%012lx\n", (unsigned long) &x);
pthread_t t;
pthread_create(&t, 0, Thread, 0);
x = 0;

View File

@ -18,7 +18,9 @@ void *Thread(void *a) {
}
int main() {
fprintf(stderr, "addr3=%p\n", XXX::YYY::ZZZ);
// On FreeBSD, the %p conversion specifier works as 0x%x and thus does not
// match to the format used in the diagnotic message.
fprintf(stderr, "addr3=0x%012lx\n", (unsigned long) XXX::YYY::ZZZ);
pthread_t t;
pthread_create(&t, 0, Thread, 0);
XXX::YYY::ZZZ[0] = 0;