[llvm-commits] [compiler-rt] r169511 - in /compiler-rt/trunk/lib: sanitizer_common/sanitizer_common.cc tsan/lit_tests/ignore_race.cc tsan/lit_tests/mutexset1.cc tsan/lit_tests/mutexset2.cc tsan/lit_tests/mutexset3.cc tsan/lit_tests/mutexset4.cc tsan/lit_tests/mutexset5.cc tsan/lit_tests/mutexset6.cc tsan/lit_tests/mutexset7.cc
Dmitry Vyukov
dvyukov at google.com
Thu Dec 6 07:42:54 PST 2012
Author: dvyukov
Date: Thu Dec 6 09:42:54 2012
New Revision: 169511
URL: http://llvm.org/viewvc/llvm-project?rev=169511&view=rev
Log:
tsan: fix lint warning and make output tests more robust
Modified:
compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.cc
compiler-rt/trunk/lib/tsan/lit_tests/ignore_race.cc
compiler-rt/trunk/lib/tsan/lit_tests/mutexset1.cc
compiler-rt/trunk/lib/tsan/lit_tests/mutexset2.cc
compiler-rt/trunk/lib/tsan/lit_tests/mutexset3.cc
compiler-rt/trunk/lib/tsan/lit_tests/mutexset4.cc
compiler-rt/trunk/lib/tsan/lit_tests/mutexset5.cc
compiler-rt/trunk/lib/tsan/lit_tests/mutexset6.cc
compiler-rt/trunk/lib/tsan/lit_tests/mutexset7.cc
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.cc?rev=169511&r1=169510&r2=169511&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.cc Thu Dec 6 09:42:54 2012
@@ -167,7 +167,7 @@
uptr map_end = map_res + map_size;
uptr res = map_res;
if (res & (alignment - 1)) // Not aligned.
- res = (map_res + alignment) & ~ (alignment - 1);
+ res = (map_res + alignment) & ~(alignment - 1);
uptr end = res + size;
if (res != map_res)
UnmapOrDie((void*)map_res, res - map_res);
Modified: compiler-rt/trunk/lib/tsan/lit_tests/ignore_race.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/lit_tests/ignore_race.cc?rev=169511&r1=169510&r2=169511&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/lit_tests/ignore_race.cc (original)
+++ compiler-rt/trunk/lib/tsan/lit_tests/ignore_race.cc Thu Dec 6 09:42:54 2012
@@ -28,4 +28,4 @@
return 0;
}
-// CHECK-NOT: ThreadSanitizer
+// CHECK-NOT: WARNING: ThreadSanitizer: data race
Modified: compiler-rt/trunk/lib/tsan/lit_tests/mutexset1.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/lit_tests/mutexset1.cc?rev=169511&r1=169510&r2=169511&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/lit_tests/mutexset1.cc (original)
+++ compiler-rt/trunk/lib/tsan/lit_tests/mutexset1.cc Thu Dec 6 09:42:54 2012
@@ -30,9 +30,10 @@
}
// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK: Write of size 4 at {{.*}} by thread T1 (mutexes: write M1):
+// CHECK: Write of size 4 at {{.*}} by thread T1
+// CHECK: (mutexes: write [[M1:M[0-9]+]]):
// CHECK: Previous write of size 4 at {{.*}} by thread T2:
-// CHECK: Mutex M1 created at:
+// CHECK: Mutex [[M1]] created at:
// CHECK: #0 pthread_mutex_init
// CHECK: #1 main {{.*}}/mutexset1.cc:23
Modified: compiler-rt/trunk/lib/tsan/lit_tests/mutexset2.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/lit_tests/mutexset2.cc?rev=169511&r1=169510&r2=169511&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/lit_tests/mutexset2.cc (original)
+++ compiler-rt/trunk/lib/tsan/lit_tests/mutexset2.cc Thu Dec 6 09:42:54 2012
@@ -31,8 +31,9 @@
// CHECK: WARNING: ThreadSanitizer: data race
// CHECK: Write of size 4 at {{.*}} by thread T2:
-// CHECK: Previous write of size 4 at {{.*}} by thread T1 (mutexes: write M1):
-// CHECK: Mutex M1 created at:
+// CHECK: Previous write of size 4 at {{.*}} by thread T1
+// CHECK: (mutexes: write [[M1:M[0-9]+]]):
+// CHECK: Mutex [[M1]] created at:
// CHECK: #0 pthread_mutex_init
// CHECK: #1 main {{.*}}/mutexset2.cc:23
Modified: compiler-rt/trunk/lib/tsan/lit_tests/mutexset3.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/lit_tests/mutexset3.cc?rev=169511&r1=169510&r2=169511&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/lit_tests/mutexset3.cc (original)
+++ compiler-rt/trunk/lib/tsan/lit_tests/mutexset3.cc Thu Dec 6 09:42:54 2012
@@ -35,12 +35,13 @@
}
// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK: Write of size 4 at {{.*}} by thread T1 (mutexes: write M1, write M2):
+// CHECK: Write of size 4 at {{.*}} by thread T1
+// CHECK: (mutexes: write [[M1:M[0-9]+]], write [[M2:M[0-9]+]]):
// CHECK: Previous write of size 4 at {{.*}} by thread T2:
-// CHECK: Mutex M1 created at:
+// CHECK: Mutex [[M1]] created at:
// CHECK: #0 pthread_mutex_init
// CHECK: #1 main {{.*}}/mutexset3.cc:26
-// CHECK: Mutex M2 created at:
+// CHECK: Mutex [[M2]] created at:
// CHECK: #0 pthread_mutex_init
// CHECK: #1 main {{.*}}/mutexset3.cc:27
Modified: compiler-rt/trunk/lib/tsan/lit_tests/mutexset4.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/lit_tests/mutexset4.cc?rev=169511&r1=169510&r2=169511&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/lit_tests/mutexset4.cc (original)
+++ compiler-rt/trunk/lib/tsan/lit_tests/mutexset4.cc Thu Dec 6 09:42:54 2012
@@ -37,11 +37,11 @@
// CHECK: WARNING: ThreadSanitizer: data race
// CHECK: Write of size 4 at {{.*}} by thread T2:
// CHECK: Previous write of size 4 at {{.*}} by thread T1
-// CHECK: (mutexes: write M1, write M2):
-// CHECK: Mutex M1 created at:
+// CHECK: (mutexes: write [[M1:M[0-9]+]], write [[M2:M[0-9]+]]):
+// CHECK: Mutex [[M1]] created at:
// CHECK: #0 pthread_mutex_init
// CHECK: #1 main {{.*}}/mutexset4.cc:26
-// CHECK: Mutex M2 created at:
+// CHECK: Mutex [[M2]] created at:
// CHECK: #0 pthread_mutex_init
// CHECK: #1 main {{.*}}/mutexset4.cc:27
Modified: compiler-rt/trunk/lib/tsan/lit_tests/mutexset5.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/lit_tests/mutexset5.cc?rev=169511&r1=169510&r2=169511&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/lit_tests/mutexset5.cc (original)
+++ compiler-rt/trunk/lib/tsan/lit_tests/mutexset5.cc Thu Dec 6 09:42:54 2012
@@ -35,12 +35,14 @@
}
// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK: Write of size 4 at {{.*}} by thread T1 (mutexes: write M1):
-// CHECK: Previous write of size 4 at {{.*}} by thread T2 (mutexes: write M2):
-// CHECK: Mutex M1 created at:
+// CHECK: Write of size 4 at {{.*}} by thread T1
+// CHECK: (mutexes: write [[M1:M[0-9]+]]):
+// CHECK: Previous write of size 4 at {{.*}} by thread T2
+// CHECK: (mutexes: write [[M2:M[0-9]+]]):
+// CHECK: Mutex [[M1]] created at:
// CHECK: #0 pthread_mutex_init
// CHECK: #1 main {{.*}}/mutexset5.cc:26
-// CHECK: Mutex M2 created at:
+// CHECK: Mutex [[M2]] created at:
// CHECK: #0 pthread_mutex_init
// CHECK: #1 main {{.*}}/mutexset5.cc:27
Modified: compiler-rt/trunk/lib/tsan/lit_tests/mutexset6.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/lit_tests/mutexset6.cc?rev=169511&r1=169510&r2=169511&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/lit_tests/mutexset6.cc (original)
+++ compiler-rt/trunk/lib/tsan/lit_tests/mutexset6.cc Thu Dec 6 09:42:54 2012
@@ -42,13 +42,14 @@
}
// CHECK: WARNING: ThreadSanitizer: data race
-// CHECK: Write of size 4 at {{.*}} by thread T1 (mutexes: write M1):
+// CHECK: Write of size 4 at {{.*}} by thread T1
+// CHECK: (mutexes: write [[M1:M[0-9]+]]):
// CHECK: Previous write of size 4 at {{.*}} by thread T2
-// CHECK: (mutexes: write M2, read M3):
-// CHECK: Mutex M1 created at:
+// CHECK: (mutexes: write [[M2:M[0-9]+]], read [[M3:M[0-9]+]]):
+// CHECK: Mutex [[M1]] created at:
// CHECK: #1 main {{.*}}/mutexset6.cc:31
-// CHECK: Mutex M2 created at:
+// CHECK: Mutex [[M2]] created at:
// CHECK: #1 main {{.*}}/mutexset6.cc:32
-// CHECK: Mutex M3 created at:
+// CHECK: Mutex [[M3]] created at:
// CHECK: #1 main {{.*}}/mutexset6.cc:33
Modified: compiler-rt/trunk/lib/tsan/lit_tests/mutexset7.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/lit_tests/mutexset7.cc?rev=169511&r1=169510&r2=169511&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/lit_tests/mutexset7.cc (original)
+++ compiler-rt/trunk/lib/tsan/lit_tests/mutexset7.cc Thu Dec 6 09:42:54 2012
@@ -32,7 +32,7 @@
// CHECK: WARNING: ThreadSanitizer: data race
// CHECK: Write of size 4 at {{.*}} by thread T1:
// CHECK: Previous write of size 4 at {{.*}} by thread T2
-// CHECK: (mutexes: write M{{[0-9]+}}):
-// CHECK: Mutex M{{[0-9]+}} is already destroyed
+// CHECK: (mutexes: write [[M1:M[0-9]+]]):
+// CHECK: Mutex [[M1]] is already destroyed
// CHECK-NOT: Mutex {{.*}} created at
More information about the llvm-commits
mailing list