diff options
author | Alexey Samsonov <samsonov@google.com> | 2012-12-28 08:38:09 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2012-12-28 08:38:09 +0000 |
commit | f96bfd884920bc326ca86772a06d9d315d1498b0 (patch) | |
tree | a8f6b39d53a8d398f12c35d4c2702d53e1ccb325 | |
parent | 9785f519b48eb54fb63773fb629439d1859a1bda (diff) | |
download | bcm5719-llvm-f96bfd884920bc326ca86772a06d9d315d1498b0.tar.gz bcm5719-llvm-f96bfd884920bc326ca86772a06d9d315d1498b0.zip |
Make ASan and TSan tests a bit less brittle with @LINE FileCheck macro
llvm-svn: 171181
-rw-r--r-- | compiler-rt/lib/asan/lit_tests/Linux/initialization-bug-any-order.cc | 2 | ||||
-rw-r--r-- | compiler-rt/lib/asan/lit_tests/global-overflow.cc | 2 | ||||
-rw-r--r-- | compiler-rt/lib/asan/lit_tests/heap-overflow.cc | 2 | ||||
-rw-r--r-- | compiler-rt/lib/asan/lit_tests/large_func_test.cc | 27 | ||||
-rw-r--r-- | compiler-rt/lib/asan/lit_tests/null_deref.cc | 19 | ||||
-rw-r--r-- | compiler-rt/lib/asan/lit_tests/sanity_check_pure_c.c | 4 | ||||
-rw-r--r-- | compiler-rt/lib/asan/lit_tests/shared-lib-test.cc | 2 | ||||
-rw-r--r-- | compiler-rt/lib/asan/lit_tests/stack-overflow.cc | 2 | ||||
-rw-r--r-- | compiler-rt/lib/asan/lit_tests/strncpy-overflow.cc | 6 | ||||
-rw-r--r-- | compiler-rt/lib/tsan/lit_tests/mutexset1.cc | 16 | ||||
-rw-r--r-- | compiler-rt/lib/tsan/lit_tests/mutexset2.cc | 16 | ||||
-rw-r--r-- | compiler-rt/lib/tsan/lit_tests/mutexset3.cc | 22 | ||||
-rw-r--r-- | compiler-rt/lib/tsan/lit_tests/mutexset4.cc | 22 | ||||
-rw-r--r-- | compiler-rt/lib/tsan/lit_tests/mutexset5.cc | 24 | ||||
-rw-r--r-- | compiler-rt/lib/tsan/lit_tests/mutexset6.cc | 24 | ||||
-rw-r--r-- | compiler-rt/lib/tsan/lit_tests/signal_malloc.cc | 7 |
16 files changed, 89 insertions, 108 deletions
diff --git a/compiler-rt/lib/asan/lit_tests/Linux/initialization-bug-any-order.cc b/compiler-rt/lib/asan/lit_tests/Linux/initialization-bug-any-order.cc index c43b1f5b5ee..645fe1c85ed 100644 --- a/compiler-rt/lib/asan/lit_tests/Linux/initialization-bug-any-order.cc +++ b/compiler-rt/lib/asan/lit_tests/Linux/initialization-bug-any-order.cc @@ -22,7 +22,7 @@ int __attribute__((noinline)) initX() { 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.*}} } diff --git a/compiler-rt/lib/asan/lit_tests/global-overflow.cc b/compiler-rt/lib/asan/lit_tests/global-overflow.cc index fec3ce8340e..6a2f12e106f 100644 --- a/compiler-rt/lib/asan/lit_tests/global-overflow.cc +++ b/compiler-rt/lib/asan/lit_tests/global-overflow.cc @@ -17,7 +17,7 @@ int main(int argc, char **argv) { 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]; diff --git a/compiler-rt/lib/asan/lit_tests/heap-overflow.cc b/compiler-rt/lib/asan/lit_tests/heap-overflow.cc index 2cd6d03eea2..2648ec7e5f1 100644 --- a/compiler-rt/lib/asan/lit_tests/heap-overflow.cc +++ b/compiler-rt/lib/asan/lit_tests/heap-overflow.cc @@ -22,7 +22,7 @@ int main(int argc, char **argv) { 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:}} diff --git a/compiler-rt/lib/asan/lit_tests/large_func_test.cc b/compiler-rt/lib/asan/lit_tests/large_func_test.cc index f67b150db7c..a74828811f7 100644 --- a/compiler-rt/lib/asan/lit_tests/large_func_test.cc +++ b/compiler-rt/lib/asan/lit_tests/large_func_test.cc @@ -29,7 +29,14 @@ static void LargeFunction(int *x, int zero) { 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 @@ static void LargeFunction(int *x, int zero) { 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}} diff --git a/compiler-rt/lib/asan/lit_tests/null_deref.cc b/compiler-rt/lib/asan/lit_tests/null_deref.cc index 64aec1230ae..60a521d1c21 100644 --- a/compiler-rt/lib/asan/lit_tests/null_deref.cc +++ b/compiler-rt/lib/asan/lit_tests/null_deref.cc @@ -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}} diff --git a/compiler-rt/lib/asan/lit_tests/sanity_check_pure_c.c b/compiler-rt/lib/asan/lit_tests/sanity_check_pure_c.c index 2b5090b09ee..3d830653e33 100644 --- a/compiler-rt/lib/asan/lit_tests/sanity_check_pure_c.c +++ b/compiler-rt/lib/asan/lit_tests/sanity_check_pure_c.c @@ -13,7 +13,7 @@ int main() { 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]] } diff --git a/compiler-rt/lib/asan/lit_tests/shared-lib-test.cc b/compiler-rt/lib/asan/lit_tests/shared-lib-test.cc index fdda3525d6a..05bf3ecdf4f 100644 --- a/compiler-rt/lib/asan/lit_tests/shared-lib-test.cc +++ b/compiler-rt/lib/asan/lit_tests/shared-lib-test.cc @@ -49,6 +49,6 @@ int main(int argc, char *argv[]) { // 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; } diff --git a/compiler-rt/lib/asan/lit_tests/stack-overflow.cc b/compiler-rt/lib/asan/lit_tests/stack-overflow.cc index 0caa7df3bf5..3deb1e91de6 100644 --- a/compiler-rt/lib/asan/lit_tests/stack-overflow.cc +++ b/compiler-rt/lib/asan/lit_tests/stack-overflow.cc @@ -13,7 +13,7 @@ int main(int argc, char **argv) { 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; } diff --git a/compiler-rt/lib/asan/lit_tests/strncpy-overflow.cc b/compiler-rt/lib/asan/lit_tests/strncpy-overflow.cc index 9381f13788c..18711843c4c 100644 --- a/compiler-rt/lib/asan/lit_tests/strncpy-overflow.cc +++ b/compiler-rt/lib/asan/lit_tests/strncpy-overflow.cc @@ -25,16 +25,16 @@ int main(int argc, char **argv) { // 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]; } diff --git a/compiler-rt/lib/tsan/lit_tests/mutexset1.cc b/compiler-rt/lib/tsan/lit_tests/mutexset1.cc index e27e0566a37..f32a770ab07 100644 --- a/compiler-rt/lib/tsan/lit_tests/mutexset1.cc +++ b/compiler-rt/lib/tsan/lit_tests/mutexset1.cc @@ -20,6 +20,13 @@ void *Thread2(void *x) { } 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 @@ int main() { 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 - diff --git a/compiler-rt/lib/tsan/lit_tests/mutexset2.cc b/compiler-rt/lib/tsan/lit_tests/mutexset2.cc index 8c850438349..15d23033251 100644 --- a/compiler-rt/lib/tsan/lit_tests/mutexset2.cc +++ b/compiler-rt/lib/tsan/lit_tests/mutexset2.cc @@ -20,6 +20,13 @@ void *Thread2(void *x) { } 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 @@ int main() { 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 - diff --git a/compiler-rt/lib/tsan/lit_tests/mutexset3.cc b/compiler-rt/lib/tsan/lit_tests/mutexset3.cc index 63123f844cb..6ac7ad15e4f 100644 --- a/compiler-rt/lib/tsan/lit_tests/mutexset3.cc +++ b/compiler-rt/lib/tsan/lit_tests/mutexset3.cc @@ -23,6 +23,16 @@ void *Thread2(void *x) { } 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 @@ int main() { 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 - diff --git a/compiler-rt/lib/tsan/lit_tests/mutexset4.cc b/compiler-rt/lib/tsan/lit_tests/mutexset4.cc index 68ed4756b9d..75684cf9ae5 100644 --- a/compiler-rt/lib/tsan/lit_tests/mutexset4.cc +++ b/compiler-rt/lib/tsan/lit_tests/mutexset4.cc @@ -23,6 +23,16 @@ void *Thread2(void *x) { } 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 @@ int main() { 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 - diff --git a/compiler-rt/lib/tsan/lit_tests/mutexset5.cc b/compiler-rt/lib/tsan/lit_tests/mutexset5.cc index 85fdadd81b7..6e75810aff2 100644 --- a/compiler-rt/lib/tsan/lit_tests/mutexset5.cc +++ b/compiler-rt/lib/tsan/lit_tests/mutexset5.cc @@ -23,6 +23,17 @@ void *Thread2(void *x) { } 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 @@ int main() { 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 - diff --git a/compiler-rt/lib/tsan/lit_tests/mutexset6.cc b/compiler-rt/lib/tsan/lit_tests/mutexset6.cc index b28c21c5813..4b19a12e043 100644 --- a/compiler-rt/lib/tsan/lit_tests/mutexset6.cc +++ b/compiler-rt/lib/tsan/lit_tests/mutexset6.cc @@ -28,6 +28,17 @@ void *Thread2(void *x) { } 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 @@ int main() { 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 - diff --git a/compiler-rt/lib/tsan/lit_tests/signal_malloc.cc b/compiler-rt/lib/tsan/lit_tests/signal_malloc.cc index 86ae4367cdd..cee997cdb76 100644 --- a/compiler-rt/lib/tsan/lit_tests/signal_malloc.cc +++ b/compiler-rt/lib/tsan/lit_tests/signal_malloc.cc @@ -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 @@ int main() { 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 - |