[compiler-rt] r219398 - [Tsan] Fix the global_race tests to pass on FreeBSD
Viktor Kutuzov
vkutuzov at accesssoftek.com
Thu Oct 9 02:35:26 PDT 2014
Author: vkutuzov
Date: Thu Oct 9 04:35:25 2014
New Revision: 219398
URL: http://llvm.org/viewvc/llvm-project?rev=219398&view=rev
Log:
[Tsan] Fix the global_race tests to pass on FreeBSD
Differential Revision: http://reviews.llvm.org/D5668
Modified:
compiler-rt/trunk/test/tsan/global_race.cc
compiler-rt/trunk/test/tsan/global_race2.cc
compiler-rt/trunk/test/tsan/global_race3.cc
Modified: compiler-rt/trunk/test/tsan/global_race.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/global_race.cc?rev=219398&r1=219397&r2=219398&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/global_race.cc (original)
+++ compiler-rt/trunk/test/tsan/global_race.cc Thu Oct 9 04:35:25 2014
@@ -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;
Modified: compiler-rt/trunk/test/tsan/global_race2.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/global_race2.cc?rev=219398&r1=219397&r2=219398&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/global_race2.cc (original)
+++ compiler-rt/trunk/test/tsan/global_race2.cc Thu Oct 9 04:35:25 2014
@@ -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;
Modified: compiler-rt/trunk/test/tsan/global_race3.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/global_race3.cc?rev=219398&r1=219397&r2=219398&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/global_race3.cc (original)
+++ compiler-rt/trunk/test/tsan/global_race3.cc Thu Oct 9 04:35:25 2014
@@ -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;
More information about the llvm-commits
mailing list