testsuite: Add profile_update_atomic check to gcov-20.c [PR114614]

Message ID dae0f576-85fd-4955-5cec-256e08e43ae7@linux.ibm.com
State New
Headers
Series testsuite: Add profile_update_atomic check to gcov-20.c [PR114614] |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_gcc_check--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_gcc_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gcc_check--master-arm warning Patch is already merged

Commit Message

Kewen.Lin April 8, 2024, 9:23 a.m. UTC
  Hi,

As PR114614 shows, the newly added test case gcov-20.c by
commit r14-9789-g08a52331803f66 failed on targets which do
not support atomic profile update, there would be a message
like:

  warning: target does not support atomic profile update,
           single mode is selected

Since the test case adopts -fprofile-update=atomic, it
requires effective target check profile_update_atomic, this
patch is to add the check accordingly.

Tested well on x86_64-redhat-linux, powerpc64-linux-gnu P8/P9
and powerpc64le-linux-gnu P9/P10.

Is it ok for trunk?

BR,
Kewen
-----
	PR testsuite/114614

gcc/testsuite/ChangeLog:

	* gcc.misc-tests/gcov-20.c: Add effective target check
	profile_update_atomic.
---
 gcc/testsuite/gcc.misc-tests/gcov-20.c | 1 +
 1 file changed, 1 insertion(+)

--
2.43.0
  

Comments

Richard Biener April 8, 2024, 10:47 a.m. UTC | #1
On Mon, Apr 8, 2024 at 11:23 AM Kewen.Lin <linkw@linux.ibm.com> wrote:
>
> Hi,
>
> As PR114614 shows, the newly added test case gcov-20.c by
> commit r14-9789-g08a52331803f66 failed on targets which do
> not support atomic profile update, there would be a message
> like:
>
>   warning: target does not support atomic profile update,
>            single mode is selected
>
> Since the test case adopts -fprofile-update=atomic, it
> requires effective target check profile_update_atomic, this
> patch is to add the check accordingly.
>
> Tested well on x86_64-redhat-linux, powerpc64-linux-gnu P8/P9
> and powerpc64le-linux-gnu P9/P10.
>
> Is it ok for trunk?

OK

> BR,
> Kewen
> -----
>         PR testsuite/114614
>
> gcc/testsuite/ChangeLog:
>
>         * gcc.misc-tests/gcov-20.c: Add effective target check
>         profile_update_atomic.
> ---
>  gcc/testsuite/gcc.misc-tests/gcov-20.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/gcc/testsuite/gcc.misc-tests/gcov-20.c b/gcc/testsuite/gcc.misc-tests/gcov-20.c
> index 215faffc980..ca8c12aad2b 100644
> --- a/gcc/testsuite/gcc.misc-tests/gcov-20.c
> +++ b/gcc/testsuite/gcc.misc-tests/gcov-20.c
> @@ -1,5 +1,6 @@
>  /* { dg-options "-fcondition-coverage -ftest-coverage -fprofile-update=atomic" } */
>  /* { dg-do run { target native } } */
> +/* { dg-require-effective-target profile_update_atomic } */
>
>  /* Some side effect to stop branches from being pruned */
>  int x = 0;
> --
> 2.43.0
  
Kewen.Lin April 9, 2024, 2:07 a.m. UTC | #2
on 2024/4/8 18:47, Richard Biener wrote:
> On Mon, Apr 8, 2024 at 11:23 AM Kewen.Lin <linkw@linux.ibm.com> wrote:
>>
>> Hi,
>>
>> As PR114614 shows, the newly added test case gcov-20.c by
>> commit r14-9789-g08a52331803f66 failed on targets which do
>> not support atomic profile update, there would be a message
>> like:
>>
>>   warning: target does not support atomic profile update,
>>            single mode is selected
>>
>> Since the test case adopts -fprofile-update=atomic, it
>> requires effective target check profile_update_atomic, this
>> patch is to add the check accordingly.
>>
>> Tested well on x86_64-redhat-linux, powerpc64-linux-gnu P8/P9
>> and powerpc64le-linux-gnu P9/P10.
>>
>> Is it ok for trunk?
> 
> OK

Thanks, pushed as r14-9851.

BR,
Kewen

> 
>> BR,
>> Kewen
>> -----
>>         PR testsuite/114614
>>
>> gcc/testsuite/ChangeLog:
>>
>>         * gcc.misc-tests/gcov-20.c: Add effective target check
>>         profile_update_atomic.
>> ---
>>  gcc/testsuite/gcc.misc-tests/gcov-20.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/gcc/testsuite/gcc.misc-tests/gcov-20.c b/gcc/testsuite/gcc.misc-tests/gcov-20.c
>> index 215faffc980..ca8c12aad2b 100644
>> --- a/gcc/testsuite/gcc.misc-tests/gcov-20.c
>> +++ b/gcc/testsuite/gcc.misc-tests/gcov-20.c
>> @@ -1,5 +1,6 @@
>>  /* { dg-options "-fcondition-coverage -ftest-coverage -fprofile-update=atomic" } */
>>  /* { dg-do run { target native } } */
>> +/* { dg-require-effective-target profile_update_atomic } */
>>
>>  /* Some side effect to stop branches from being pruned */
>>  int x = 0;
>> --
>> 2.43.0
  

Patch

diff --git a/gcc/testsuite/gcc.misc-tests/gcov-20.c b/gcc/testsuite/gcc.misc-tests/gcov-20.c
index 215faffc980..ca8c12aad2b 100644
--- a/gcc/testsuite/gcc.misc-tests/gcov-20.c
+++ b/gcc/testsuite/gcc.misc-tests/gcov-20.c
@@ -1,5 +1,6 @@ 
 /* { dg-options "-fcondition-coverage -ftest-coverage -fprofile-update=atomic" } */
 /* { dg-do run { target native } } */
+/* { dg-require-effective-target profile_update_atomic } */

 /* Some side effect to stop branches from being pruned */
 int x = 0;