On 9/8/15 4:09 PM, Jonathan Roelofs wrote:
In a similar vein to [1], this does the same for the tsan tests. These tests also suffer from being overly picky w.r.t. ansi escape codes in the runtime diagnostics (which can't be suppressed as explained in [2]). Tested on a remote x86_64-linux-gnu target. 2015-09-08 Jonathan Roelofs <jonat...@codesourcery.com> * c-c++-common/tsan/race_on_mutex.c: Don't be picky about ansi escape codes in diagnostics. * c-c++-common/tsan/free_race2.c: Ditto. * c-c++-common/tsan/mutexset1.c: Ditto. * c-c++-common/tsan/fd_pipe_race.c: Ditto. * c-c++-common/tsan/atomic_stack.c: Ditto. * c-c++-common/tsan/write_in_reader_lock.c: Ditto. * c-c++-common/tsan/free_race.c: Ditto. * c-c++-common/tsan/simple_stack.c: Ditto.
Forgot to attach the patch itself. Jon
Cheers, Jon 1: https://gcc.gnu.org/ml/gcc-patches/2015-08/msg01755.html 2: https://gcc.gnu.org/ml/gcc-patches/2015-09/msg00292.html
-- Jon Roelofs jonat...@codesourcery.com CodeSourcery / Mentor Embedded
Index: gcc/testsuite/c-c++-common/tsan/simple_stack.c =================================================================== --- gcc/testsuite/c-c++-common/tsan/simple_stack.c (revision 454039) +++ gcc/testsuite/c-c++-common/tsan/simple_stack.c (working copy) @@ -52,17 +52,17 @@ } /* { dg-output "WARNING: ThreadSanitizer: data race.*" } */ -/* { dg-output " Write of size 4 at .* by thread T1:(\n|\r\n|\r)" } */ +/* { dg-output " Write of size 4 at .* by thread T1:.*" } */ /* { dg-output " #0 foo1.* .*(simple_stack.c:11|\\?{2}:0) (.*)" } */ /* { dg-output " #1 bar1.* .*(simple_stack.c:16|\\?{2}:0) (.*)" } */ /* { dg-output " #2 Thread1.* .*(simple_stack.c:30|\\?{2}:0) (.*)" } */ -/* { dg-output " Previous read of size 4 at .* by thread T2:(\n|\r\n|\r)" } */ +/* { dg-output " Previous read of size 4 at .* by thread T2:.*" } */ /* { dg-output " #0 foo2.* .*(simple_stack.c:20|\\?{2}:0) (.*)" } */ /* { dg-output " #1 bar2.* .*(simple_stack.c:25|\\?{2}:0) (.*)" } */ /* { dg-output " #2 Thread2.* .*(simple_stack.c:35|\\?{2}:0) (.*)" } */ -/* { dg-output " Thread T1 \\(tid=.*, running\\) created by main thread at:(\n|\r\n|\r)" } */ +/* { dg-output " Thread T1 \\(tid=.*, running\\) created by main thread at:.*" } */ /* { dg-output " #0 pthread_create .* (.*)" } */ /* { dg-output " #1 StartThread.* .*(simple_stack.c:41|\\?{2}:0) (.*)" } */ -/* { dg-output " Thread T2 (.*) created by main thread at:(\n|\r\n|\r)" } */ +/* { dg-output " Thread T2 (.*) created by main thread at:.*" } */ /* { dg-output " #0 pthread_create .* (.*)" } */ /* { dg-output " #1 StartThread.* .*(simple_stack.c:41|\\?{2}:0) (.*)" } */ Index: gcc/testsuite/c-c++-common/tsan/race_on_mutex.c =================================================================== --- gcc/testsuite/c-c++-common/tsan/race_on_mutex.c (revision 454039) +++ gcc/testsuite/c-c++-common/tsan/race_on_mutex.c (working copy) @@ -36,10 +36,10 @@ return 0; } -/* { dg-output "WARNING: ThreadSanitizer: data race.*(\n|\r\n|\r)" } */ -/* { dg-output " Atomic read of size 1 at .* by thread T2:(\n|\r\n|\r)" } */ +/* { dg-output "WARNING: ThreadSanitizer: data race.*" } */ +/* { dg-output " Atomic read of size 1 at .* by thread T2:.*" } */ /* { dg-output " #0 pthread_mutex_lock.*" } */ -/* { dg-output " #1 Thread2.* .*(race_on_mutex.c:22|\\?{2}:0) (.*)" } */ -/* { dg-output " Previous write of size 1 at .* by thread T1:(\n|\r\n|\r)" } */ +/* { dg-output " #1 Thread2.* .*(race_on_mutex.c:22|\\?{2}:0) .*" } */ +/* { dg-output " Previous write of size 1 at .* by thread T1:.*" } */ /* { dg-output " #0 pthread_mutex_init .* (.)*" } */ /* { dg-output " #1 Thread1.* .*(race_on_mutex.c:12|\\?{2}:0) .*" } */ Index: gcc/testsuite/c-c++-common/tsan/free_race2.c =================================================================== --- gcc/testsuite/c-c++-common/tsan/free_race2.c (revision 454039) +++ gcc/testsuite/c-c++-common/tsan/free_race2.c (working copy) @@ -17,12 +17,12 @@ return 0; } -/* { dg-output "WARNING: ThreadSanitizer: heap-use-after-free.*(\n|\r\n|\r)" } */ -/* { dg-output " Write of size 4.* by main thread:(\n|\r\n|\r)" } */ +/* { dg-output "WARNING: ThreadSanitizer: heap-use-after-free.*" } */ +/* { dg-output " Write of size 4.* by main thread:.*" } */ /* { dg-output " #0 bar.*" } */ /* { dg-output " #1 main .*" } */ -/* { dg-output " Previous write of size 8 at .* by main thread:(\n|\r\n|\r)" } */ +/* { dg-output " Previous write of size 8 at .* by main thread:.*" } */ /* { dg-output " #0 free .*" } */ -/* { dg-output " #\(1|2\) foo.*(\n|\r\n|\r)" } */ +/* { dg-output " #\(1|2\) foo.*" } */ /* { dg-output " #\(2|3\) main .*" } */ Index: gcc/testsuite/c-c++-common/tsan/mutexset1.c =================================================================== --- gcc/testsuite/c-c++-common/tsan/mutexset1.c (revision 454039) +++ gcc/testsuite/c-c++-common/tsan/mutexset1.c (working copy) @@ -35,7 +35,7 @@ return 0; } -/* { dg-output "WARNING: ThreadSanitizer: data race.*(\n|\r\n|\r)" } */ +/* { dg-output "WARNING: ThreadSanitizer: data race.*" } */ /* { dg-output " Read of size 4 at 0x\[0-9a-f\]+ by thread T1 \\(mutexes: write M\[0-9\]\\):.*" } */ /* { dg-output " Previous write of size 4 at 0x\[0-9a-f\]+ by thread T2:.*" } */ /* { dg-output " Mutex M\[0-9\] \\(0x.*\\) created at:.*" } */ Index: gcc/testsuite/c-c++-common/tsan/fd_pipe_race.c =================================================================== --- gcc/testsuite/c-c++-common/tsan/fd_pipe_race.c (revision 454039) +++ gcc/testsuite/c-c++-common/tsan/fd_pipe_race.c (working copy) @@ -32,10 +32,10 @@ return 0; } -/* { dg-output "WARNING: ThreadSanitizer: data race.*\n" } */ -/* { dg-output " Write of size 8.*\n" } */ -/* { dg-output " #0 close.*\n" } */ -/* { dg-output " #1 Thread2.*\n" } */ -/* { dg-output " Previous read of size 8.*\n" } */ -/* { dg-output " #0 write.*\n" } */ -/* { dg-output " #1 Thread1.*\n" } */ +/* { dg-output "WARNING: ThreadSanitizer: data race.*" } */ +/* { dg-output " Write of size 8.*" } */ +/* { dg-output " #0 close.*" } */ +/* { dg-output " #1 Thread2.*" } */ +/* { dg-output " Previous read of size 8.*" } */ +/* { dg-output " #0 write.*" } */ +/* { dg-output " #1 Thread1.*" } */ Index: gcc/testsuite/c-c++-common/tsan/atomic_stack.c =================================================================== --- gcc/testsuite/c-c++-common/tsan/atomic_stack.c (revision 454039) +++ gcc/testsuite/c-c++-common/tsan/atomic_stack.c (working copy) @@ -29,7 +29,7 @@ return 0; } -/* { dg-output "WARNING: ThreadSanitizer: data race.*(\n|\r\n|\r)" } */ +/* { dg-output "WARNING: ThreadSanitizer: data race.*" } */ /* { dg-output " Atomic write of size 4.*" } */ /* { dg-output " #0 __tsan_atomic32_fetch_add.*" } */ /* { dg-output " #1 Thread1.*" } */ Index: gcc/testsuite/c-c++-common/tsan/write_in_reader_lock.c =================================================================== --- gcc/testsuite/c-c++-common/tsan/write_in_reader_lock.c (revision 454039) +++ gcc/testsuite/c-c++-common/tsan/write_in_reader_lock.c (working copy) @@ -33,7 +33,7 @@ return 0; } -/* { dg-output "WARNING: ThreadSanitizer: data race.*(\n|\r\n|\r)" } */ +/* { dg-output "WARNING: ThreadSanitizer: data race.*" } */ /* { dg-output " Write of size 4 at 0x\[0-9a-f\]+ by thread T1.*:(\n|\r\n|\r).*" } */ /* { dg-output " #0 Thread1.*\(write_in_reader_lock.c|\\?{2}\):\[0-9\]+ .*" } */ /* { dg-output " Previous read of size 4 at.* by main thread.*:(\n|\r\n|\r).*" } */ Index: gcc/testsuite/c-c++-common/tsan/free_race.c =================================================================== --- gcc/testsuite/c-c++-common/tsan/free_race.c (revision 454039) +++ gcc/testsuite/c-c++-common/tsan/free_race.c (working copy) @@ -17,11 +17,11 @@ return 0; } -/* { dg-output "WARNING: ThreadSanitizer: heap-use-after-free.*(\n|\r\n|\r)" } */ -/* { dg-output " Write of size 4 at.* by main thread:(\n|\r\n|\r)" } */ -/* { dg-output " #0 bar.*(\n|\r\n|\r)" } */ -/* { dg-output " #1 main.*(\n|\r\n|\r)" } */ -/* { dg-output " Previous write of size 8 at.* by main thread:(\n|\r\n|\r)" } */ -/* { dg-output " #0 free.*(\n|\r\n|\r)" } */ -/* { dg-output " #\(1|2\) foo.*(\n|\r\n|\r)" } */ -/* { dg-output " #\(2|3\) main.*(\n|\r\n|\r)" } */ +/* { dg-output "WARNING: ThreadSanitizer: heap-use-after-free.*" } */ +/* { dg-output " Write of size 4 at.* by main thread:.*" } */ +/* { dg-output " #0 bar.*" } */ +/* { dg-output " #1 main.*" } */ +/* { dg-output " Previous write of size 8 at.* by main thread:.*" } */ +/* { dg-output " #0 free.*" } */ +/* { dg-output " #\(1|2\) foo.*" } */ +/* { dg-output " #\(2|3\) main.*" } */ Index: gcc/testsuite/ChangeLog =================================================================== --- gcc/testsuite/ChangeLog (revision 454039) +++ gcc/testsuite/ChangeLog (working copy) @@ -1,3 +1,15 @@ +2015-09-08 Jonathan Roelofs <jonat...@codesourcery.com> + + * c-c++-common/tsan/race_on_mutex.c: Don't be picky about ansi escape + codes in diagnostics. + * c-c++-common/tsan/free_race2.c: Ditto. + * c-c++-common/tsan/mutexset1.c: Ditto. + * c-c++-common/tsan/fd_pipe_race.c: Ditto. + * c-c++-common/tsan/atomic_stack.c: Ditto. + * c-c++-common/tsan/write_in_reader_lock.c: Ditto. + * c-c++-common/tsan/free_race.c: Ditto. + * c-c++-common/tsan/simple_stack.c: Ditto. + 2015-07-16 Release Manager * GCC 5.2.0 released.