On 04/24/2017 05:19 PM, Jakub Jelinek wrote:
> On Mon, Apr 24, 2017 at 03:04:43PM +0200, Martin Liška wrote:
>> gcc/testsuite/ChangeLog:
>>
>> 2017-04-24  Martin Liska  <mli...@suse.cz>
>>
>>      * c-c++-common/tsan/race_on_mutex.c: Make the scanned pattern
>>      more generic.
>> ---
>>  gcc/testsuite/c-c++-common/tsan/race_on_mutex.c | 6 +++---
>>  1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/gcc/testsuite/c-c++-common/tsan/race_on_mutex.c 
>> b/gcc/testsuite/c-c++-common/tsan/race_on_mutex.c
>> index ae30d053c92..80c193789d7 100644
>> --- a/gcc/testsuite/c-c++-common/tsan/race_on_mutex.c
>> +++ b/gcc/testsuite/c-c++-common/tsan/race_on_mutex.c
>> @@ -40,6 +40,6 @@ int main() {
>>  /* { dg-output "  Atomic read of size 1 at .* by thread T2:(\n|\r\n|\r)" } 
>> */
> 
> In that case you should also change the above 1 to \[0-9]\+ or so.

Yes

> 
>>  /* { 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 "    #0 pthread_mutex_init .* (.)*" } */
>> -/* { dg-output "    #1 Thread1.* .*(race_on_mutex.c:12|\\?{2}:0) .*" } */
>> +/* { dg-output "  Previous write of size . at .* by thread T1:(\n|\r\n|\r)" 
>> } */
> 
> And here too instead of .  Also, the .* will accept newlines, so you want to
> use \[^\n\r]* instead of .* everywhere.

Fixed that. I need to conditionaly catch line:

    #0 memset 
../../../../libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:558 
(libtsan.so.0+0x000000036194)

> 
>> +/* { dg-output "    #. .*pthread_mutex_init .* (.)*" } */
>> +/* { dg-output "    #. Thread1.* .*(race_on_mutex.c:12|\\?{2}:0) .*" } */
> 
> Why the (.)* ?  Is anything matching that?

There should be just (__)?

Martin

> 
>       Jakub
> 

>From 8001530f2041a0a390e62a710f28ef42ef730cc7 Mon Sep 17 00:00:00 2001
From: marxin <mli...@suse.cz>
Date: Mon, 24 Apr 2017 14:59:18 +0200
Subject: [PATCH] Fix test-case on ppc64le (PR testsuite/79455).

gcc/testsuite/ChangeLog:

2017-04-24  Martin Liska  <mli...@suse.cz>

	* c-c++-common/tsan/race_on_mutex.c: Make the scanned pattern
	more generic.
---
 gcc/testsuite/c-c++-common/tsan/race_on_mutex.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/gcc/testsuite/c-c++-common/tsan/race_on_mutex.c b/gcc/testsuite/c-c++-common/tsan/race_on_mutex.c
index ae30d053c92..b3274a60ce5 100644
--- a/gcc/testsuite/c-c++-common/tsan/race_on_mutex.c
+++ b/gcc/testsuite/c-c++-common/tsan/race_on_mutex.c
@@ -37,9 +37,10 @@ int main() {
 }
 
 /* { 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 "  Atomic read of size \[0-9]\+ at .* by thread T2:(\n|\r\n|\r)" } */
 /* { 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 "    #0 pthread_mutex_init .* (.)*" } */
-/* { dg-output "    #1 Thread1.* .*(race_on_mutex.c:12|\\?{2}:0) .*" } */
+/* { dg-output "  Previous write of size \[0-9]\+ at .* by thread T1:(\n|\r\n|\r)" } */
+/* { dg-output "(    #. \[^\n\r\]*(\n|\r\n|\r))?" } */
+/* { dg-output "    #. (__)?pthread_mutex_init \[^\n\r\]* (.)*" } */
+/* { dg-output "    #. Thread1.* .*(race_on_mutex.c:12|\\?{2}:0) .*" } */
-- 
2.12.2

Reply via email to