[llvm-commits] [compiler-rt] r171181 - in /compiler-rt/trunk/lib: asan/lit_tests/ asan/lit_tests/Linux/ tsan/lit_tests/
Alexey Samsonov
samsonov at google.com
Fri Dec 28 00:38:09 PST 2012
Author: samsonov
Date: Fri Dec 28 02:38:09 2012
New Revision: 171181
URL: http://llvm.org/viewvc/llvm-project?rev=171181&view=rev
Log:
Make ASan and TSan tests a bit less brittle with @LINE FileCheck macro
Modified:
compiler-rt/trunk/lib/asan/lit_tests/Linux/initialization-bug-any-order.cc
compiler-rt/trunk/lib/asan/lit_tests/global-overflow.cc
compiler-rt/trunk/lib/asan/lit_tests/heap-overflow.cc
compiler-rt/trunk/lib/asan/lit_tests/large_func_test.cc
compiler-rt/trunk/lib/asan/lit_tests/null_deref.cc
compiler-rt/trunk/lib/asan/lit_tests/sanity_check_pure_c.c
compiler-rt/trunk/lib/asan/lit_tests/shared-lib-test.cc
compiler-rt/trunk/lib/asan/lit_tests/stack-overflow.cc
compiler-rt/trunk/lib/asan/lit_tests/strncpy-overflow.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/signal_malloc.cc
Modified: compiler-rt/trunk/lib/asan/lit_tests/Linux/initialization-bug-any-order.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/Linux/initialization-bug-any-order.cc?rev=171181&r1=171180&r2=171181&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/Linux/initialization-bug-any-order.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/Linux/initialization-bug-any-order.cc Fri Dec 28 02:38:09 2012
@@ -22,7 +22,7 @@
return y + 1;
// CHECK: {{AddressSanitizer: initialization-order-fiasco}}
// CHECK: {{READ of size .* at 0x.* thread T0}}
- // CHECK: {{#0 0x.* in .*initX.* .*initialization-bug-any-order.cc:22}}
+ // CHECK: {{#0 0x.* in .*initX.* .*initialization-bug-any-order.cc:}}[[@LINE-3]]
// CHECK: {{0x.* is located 0 bytes inside of global variable .*y.*}}
}
Modified: compiler-rt/trunk/lib/asan/lit_tests/global-overflow.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/global-overflow.cc?rev=171181&r1=171180&r2=171181&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/global-overflow.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/global-overflow.cc Fri Dec 28 02:38:09 2012
@@ -17,7 +17,7 @@
memset(ZZZ, 0, 10);
int res = YYY[argc * 10]; // BOOOM
// CHECK: {{READ of size 1 at 0x.* thread T0}}
- // CHECK: {{ #0 0x.* in _?main .*global-overflow.cc:18}}
+ // CHECK: {{ #0 0x.* in _?main .*global-overflow.cc:}}[[@LINE-2]]
// CHECK: {{0x.* is located 0 bytes to the right of global variable}}
// CHECK: {{.*YYY.* of size 10}}
res += XXX[argc] + ZZZ[argc];
Modified: compiler-rt/trunk/lib/asan/lit_tests/heap-overflow.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/heap-overflow.cc?rev=171181&r1=171180&r2=171181&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/heap-overflow.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/heap-overflow.cc Fri Dec 28 02:38:09 2012
@@ -22,7 +22,7 @@
memset(x, 0, 10);
int res = x[argc * 10]; // BOOOM
// CHECK: {{READ of size 1 at 0x.* thread T0}}
- // CHECK: {{ #0 0x.* in _?main .*heap-overflow.cc:23}}
+ // CHECK: {{ #0 0x.* in _?main .*heap-overflow.cc:}}[[@LINE-2]]
// CHECK: {{0x.* is located 0 bytes to the right of 10-byte region}}
// CHECK: {{allocated by thread T0 here:}}
Modified: compiler-rt/trunk/lib/asan/lit_tests/large_func_test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/large_func_test.cc?rev=171181&r1=171180&r2=171181&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/large_func_test.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/large_func_test.cc Fri Dec 28 02:38:09 2012
@@ -29,7 +29,14 @@
x[8]++;
x[9]++;
+ // CHECK: {{.*ERROR: AddressSanitizer: heap-buffer-overflow on address}}
+ // CHECK: {{0x.* at pc 0x.* bp 0x.* sp 0x.*}}
+ // CHECK: {{READ of size 4 at 0x.* thread T0}}
x[zero + 111]++; // we should report this exact line
+ // atos incorrectly extracts the symbol name for the static functions on
+ // Darwin.
+ // CHECK-Linux: {{#0 0x.* in LargeFunction.*large_func_test.cc:}}[[@LINE-3]]
+ // CHECK-Darwin: {{#0 0x.* in .*LargeFunction.*large_func_test.cc}}:[[@LINE-4]]
x[10]++;
x[11]++;
@@ -46,20 +53,10 @@
int main(int argc, char **argv) {
int *x = new int[100];
LargeFunction(x, argc - 1);
+ // CHECK: {{ #1 0x.* in _?main .*large_func_test.cc:}}[[@LINE-1]]
+ // CHECK: {{0x.* is located 44 bytes to the right of 400-byte region}}
+ // CHECK: {{allocated by thread T0 here:}}
+ // CHECK: {{ #0 0x.* in operator new.*}}
+ // CHECK: {{ #1 0x.* in _?main .*large_func_test.cc:}}[[@LINE-6]]
delete x;
}
-
-// CHECK: {{.*ERROR: AddressSanitizer: heap-buffer-overflow on address}}
-// CHECK: {{0x.* at pc 0x.* bp 0x.* sp 0x.*}}
-// CHECK: {{READ of size 4 at 0x.* thread T0}}
-
-// atos incorrectly extracts the symbol name for the static functions on
-// Darwin.
-// CHECK-Linux: {{ #0 0x.* in LargeFunction.*large_func_test.cc:32}}
-// CHECK-Darwin: {{ #0 0x.* in .*LargeFunction.*large_func_test.cc:32}}
-
-// CHECK: {{ #1 0x.* in _?main .*large_func_test.cc:48}}
-// CHECK: {{0x.* is located 44 bytes to the right of 400-byte region}}
-// CHECK: {{allocated by thread T0 here:}}
-// CHECK: {{ #0 0x.* in operator new.*}}
-// CHECK: {{ #1 0x.* in _?main .*large_func_test.cc:47}}
Modified: compiler-rt/trunk/lib/asan/lit_tests/null_deref.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/null_deref.cc?rev=171181&r1=171180&r2=171181&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/null_deref.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/null_deref.cc Fri Dec 28 02:38:09 2012
@@ -17,18 +17,15 @@
__attribute__((noinline))
static void NullDeref(int *ptr) {
- ptr[10]++;
+ // CHECK: ERROR: AddressSanitizer: SEGV on unknown address
+ // CHECK: {{0x0*00028 .*pc 0x.*}}
+ // CHECK: {{AddressSanitizer can not provide additional info.}}
+ ptr[10]++; // BOOM
+ // atos on Mac cannot extract the symbol name correctly.
+ // CHECK-Linux: {{ #0 0x.* in NullDeref.*null_deref.cc:}}[[@LINE-2]]
+ // CHECK-Darwin: {{ #0 0x.* in .*NullDeref.*null_deref.cc:}}[[@LINE-3]]
}
int main() {
NullDeref((int*)0);
+ // CHECK: {{ #1 0x.* in _?main.*null_deref.cc:}}[[@LINE-1]]
}
-
-// CHECK: ERROR: AddressSanitizer: SEGV on unknown address
-// CHECK: {{0x0*00028 .*pc 0x.*}}
-// CHECK: {{AddressSanitizer can not provide additional info.}}
-
-// atos on Mac cannot extract the symbol name correctly.
-// CHECK-Linux: {{ #0 0x.* in NullDeref.*null_deref.cc:20}}
-// CHECK-Darwin: {{ #0 0x.* in .*NullDeref.*null_deref.cc:20}}
-
-// CHECK: {{ #1 0x.* in _?main.*null_deref.cc:23}}
Modified: compiler-rt/trunk/lib/asan/lit_tests/sanity_check_pure_c.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/sanity_check_pure_c.c?rev=171181&r1=171180&r2=171181&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/sanity_check_pure_c.c (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/sanity_check_pure_c.c Fri Dec 28 02:38:09 2012
@@ -13,7 +13,7 @@
return x[5];
// CHECK: heap-use-after-free
// CHECK: free
- // CHECK: main{{.*}}sanity_check_pure_c.c:12
+ // CHECK: main{{.*}}sanity_check_pure_c.c:[[@LINE-4]]
// CHECK: malloc
- // CHECK: main{{.*}}sanity_check_pure_c.c:11
+ // CHECK: main{{.*}}sanity_check_pure_c.c:[[@LINE-7]]
}
Modified: compiler-rt/trunk/lib/asan/lit_tests/shared-lib-test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/shared-lib-test.cc?rev=171181&r1=171180&r2=171181&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/shared-lib-test.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/shared-lib-test.cc Fri Dec 28 02:38:09 2012
@@ -49,6 +49,6 @@
// CHECK: {{.*ERROR: AddressSanitizer: global-buffer-overflow}}
// CHECK: {{READ of size 4 at 0x.* thread T0}}
// CHECK: {{ #0 0x.*}}
- // CHECK: {{ #1 0x.* in _?main .*shared-lib-test.cc:48}}
+ // CHECK: {{ #1 0x.* in _?main .*shared-lib-test.cc:}}[[@LINE-4]]
return 0;
}
Modified: compiler-rt/trunk/lib/asan/lit_tests/stack-overflow.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/stack-overflow.cc?rev=171181&r1=171180&r2=171181&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/stack-overflow.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/stack-overflow.cc Fri Dec 28 02:38:09 2012
@@ -13,7 +13,7 @@
memset(x, 0, 10);
int res = x[argc * 10]; // BOOOM
// CHECK: {{READ of size 1 at 0x.* thread T0}}
- // CHECK: {{ #0 0x.* in _?main .*stack-overflow.cc:14}}
+ // CHECK: {{ #0 0x.* in _?main .*stack-overflow.cc:}}[[@LINE-2]]
// CHECK: {{Address 0x.* is .* frame <main>}}
return res;
}
Modified: compiler-rt/trunk/lib/asan/lit_tests/strncpy-overflow.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/strncpy-overflow.cc?rev=171181&r1=171180&r2=171181&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/strncpy-overflow.cc (original)
+++ compiler-rt/trunk/lib/asan/lit_tests/strncpy-overflow.cc Fri Dec 28 02:38:09 2012
@@ -25,16 +25,16 @@
// CHECK: {{WRITE of size 1 at 0x.* thread T0}}
// CHECK-Linux: {{ #0 0x.* in .*strncpy}}
// CHECK-Darwin: {{ #0 0x.* in _?wrap_strncpy}}
- // CHECK: {{ #1 0x.* in _?main .*strncpy-overflow.cc:24}}
+ // CHECK: {{ #1 0x.* in _?main .*strncpy-overflow.cc:}}[[@LINE-4]]
// CHECK: {{0x.* is located 0 bytes to the right of 9-byte region}}
// CHECK: {{allocated by thread T0 here:}}
// CHECK-Linux: {{ #0 0x.* in .*malloc}}
- // CHECK-Linux: {{ #1 0x.* in main .*strncpy-overflow.cc:23}}
+ // CHECK-Linux: {{ #1 0x.* in main .*strncpy-overflow.cc:}}[[@LINE-10]]
// CHECK-Darwin: {{ #0 0x.* in .*mz_malloc.*}}
// CHECK-Darwin: {{ #1 0x.* in malloc_zone_malloc.*}}
// CHECK-Darwin: {{ #2 0x.* in malloc.*}}
- // CHECK-Darwin: {{ #3 0x.* in _?main .*strncpy-overflow.cc:23}}
+ // CHECK-Darwin: {{ #3 0x.* in _?main .*strncpy-overflow.cc:}}[[@LINE-15]]
return short_buffer[8];
}
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=171181&r1=171180&r2=171181&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/lit_tests/mutexset1.cc (original)
+++ compiler-rt/trunk/lib/tsan/lit_tests/mutexset1.cc Fri Dec 28 02:38:09 2012
@@ -20,6 +20,13 @@
}
int main() {
+ // CHECK: WARNING: ThreadSanitizer: data race
+ // 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: #0 pthread_mutex_init
+ // CHECK: #1 main {{.*}}/mutexset1.cc:[[@LINE+1]]
pthread_mutex_init(&mtx, 0);
pthread_t t[2];
pthread_create(&t[0], NULL, Thread1, NULL);
@@ -28,12 +35,3 @@
pthread_join(t[1], NULL);
pthread_mutex_destroy(&mtx);
}
-
-// CHECK: WARNING: ThreadSanitizer: data race
-// 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: #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=171181&r1=171180&r2=171181&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/lit_tests/mutexset2.cc (original)
+++ compiler-rt/trunk/lib/tsan/lit_tests/mutexset2.cc Fri Dec 28 02:38:09 2012
@@ -20,6 +20,13 @@
}
int main() {
+ // 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:M[0-9]+]]):
+ // CHECK: Mutex [[M1]] created at:
+ // CHECK: #0 pthread_mutex_init
+ // CHECK: #1 main {{.*}}/mutexset2.cc:[[@LINE+1]]
pthread_mutex_init(&mtx, 0);
pthread_t t[2];
pthread_create(&t[0], NULL, Thread1, NULL);
@@ -28,12 +35,3 @@
pthread_join(t[1], NULL);
pthread_mutex_destroy(&mtx);
}
-
-// 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: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=171181&r1=171180&r2=171181&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/lit_tests/mutexset3.cc (original)
+++ compiler-rt/trunk/lib/tsan/lit_tests/mutexset3.cc Fri Dec 28 02:38:09 2012
@@ -23,6 +23,16 @@
}
int main() {
+ // CHECK: WARNING: ThreadSanitizer: data race
+ // 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: #0 pthread_mutex_init
+ // CHECK: #1 main {{.*}}/mutexset3.cc:[[@LINE+4]]
+ // CHECK: Mutex [[M2]] created at:
+ // CHECK: #0 pthread_mutex_init
+ // CHECK: #1 main {{.*}}/mutexset3.cc:[[@LINE+2]]
pthread_mutex_init(&mtx1, 0);
pthread_mutex_init(&mtx2, 0);
pthread_t t[2];
@@ -33,15 +43,3 @@
pthread_mutex_destroy(&mtx1);
pthread_mutex_destroy(&mtx2);
}
-
-// CHECK: WARNING: ThreadSanitizer: data race
-// 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: #0 pthread_mutex_init
-// CHECK: #1 main {{.*}}/mutexset3.cc:26
-// 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=171181&r1=171180&r2=171181&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/lit_tests/mutexset4.cc (original)
+++ compiler-rt/trunk/lib/tsan/lit_tests/mutexset4.cc Fri Dec 28 02:38:09 2012
@@ -23,6 +23,16 @@
}
int main() {
+ // 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:M[0-9]+]], write [[M2:M[0-9]+]]):
+ // CHECK: Mutex [[M1]] created at:
+ // CHECK: #0 pthread_mutex_init
+ // CHECK: #1 main {{.*}}/mutexset4.cc:[[@LINE+4]]
+ // CHECK: Mutex [[M2]] created at:
+ // CHECK: #0 pthread_mutex_init
+ // CHECK: #1 main {{.*}}/mutexset4.cc:[[@LINE+2]]
pthread_mutex_init(&mtx1, 0);
pthread_mutex_init(&mtx2, 0);
pthread_t t[2];
@@ -33,15 +43,3 @@
pthread_mutex_destroy(&mtx1);
pthread_mutex_destroy(&mtx2);
}
-
-// 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: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: #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=171181&r1=171180&r2=171181&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/lit_tests/mutexset5.cc (original)
+++ compiler-rt/trunk/lib/tsan/lit_tests/mutexset5.cc Fri Dec 28 02:38:09 2012
@@ -23,6 +23,17 @@
}
int main() {
+ // CHECK: WARNING: ThreadSanitizer: data race
+ // 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:[[@LINE+4]]
+ // CHECK: Mutex [[M2]] created at:
+ // CHECK: #0 pthread_mutex_init
+ // CHECK: #1 main {{.*}}/mutexset5.cc:[[@LINE+5]]
pthread_mutex_init(&mtx1, 0);
pthread_mutex_init(&mtx2, 0);
pthread_t t[2];
@@ -33,16 +44,3 @@
pthread_mutex_destroy(&mtx1);
pthread_mutex_destroy(&mtx2);
}
-
-// CHECK: WARNING: ThreadSanitizer: data race
-// 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: #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=171181&r1=171180&r2=171181&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/lit_tests/mutexset6.cc (original)
+++ compiler-rt/trunk/lib/tsan/lit_tests/mutexset6.cc Fri Dec 28 02:38:09 2012
@@ -28,6 +28,17 @@
}
int main() {
+ // CHECK: WARNING: ThreadSanitizer: data race
+ // 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]+]], read [[M3:M[0-9]+]]):
+ // CHECK: Mutex [[M1]] created at:
+ // CHECK: #1 main {{.*}}/mutexset6.cc:[[@LINE+5]]
+ // CHECK: Mutex [[M2]] created at:
+ // CHECK: #1 main {{.*}}/mutexset6.cc:[[@LINE+4]]
+ // CHECK: Mutex [[M3]] created at:
+ // CHECK: #1 main {{.*}}/mutexset6.cc:[[@LINE+3]]
pthread_mutex_init(&mtx1, 0);
pthread_spin_init(&mtx2, 0);
pthread_rwlock_init(&mtx3, 0);
@@ -40,16 +51,3 @@
pthread_spin_destroy(&mtx2);
pthread_rwlock_destroy(&mtx3);
}
-
-// CHECK: WARNING: ThreadSanitizer: data race
-// 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]+]], read [[M3:M[0-9]+]]):
-// CHECK: Mutex [[M1]] created at:
-// CHECK: #1 main {{.*}}/mutexset6.cc:31
-// CHECK: Mutex [[M2]] created at:
-// CHECK: #1 main {{.*}}/mutexset6.cc:32
-// CHECK: Mutex [[M3]] created at:
-// CHECK: #1 main {{.*}}/mutexset6.cc:33
-
Modified: compiler-rt/trunk/lib/tsan/lit_tests/signal_malloc.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/lit_tests/signal_malloc.cc?rev=171181&r1=171180&r2=171181&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/lit_tests/signal_malloc.cc (original)
+++ compiler-rt/trunk/lib/tsan/lit_tests/signal_malloc.cc Fri Dec 28 02:38:09 2012
@@ -6,6 +6,9 @@
#include <unistd.h>
static void handler(int, siginfo_t*, void*) {
+ // CHECK: WARNING: ThreadSanitizer: signal-unsafe call inside of a signal
+ // CHECK: #0 malloc
+ // CHECK: #1 handler(int, siginfo*, void*) {{.*}}signal_malloc.cc:[[@LINE+1]]
volatile char *p = (char*)malloc(1);
p[0] = 0;
free((void*)p);
@@ -20,7 +23,3 @@
return 0;
}
-// CHECK: WARNING: ThreadSanitizer: signal-unsafe call inside of a signal
-// CHECK: #0 malloc
-// CHECK: #1 handler(int, siginfo*, void*) {{.*}}signal_malloc.cc:9
-
More information about the llvm-commits
mailing list