diff mbox series

ARM/testsuite: Use non-capturing parentheses with pr53447-5.c

Message ID alpine.DEB.2.20.2311220044380.5892@tpp.orcam.me.uk
State New
Headers show
Series ARM/testsuite: Use non-capturing parentheses with pr53447-5.c | expand

Commit Message

Maciej W. Rozycki Nov. 22, 2023, 1:40 a.m. UTC
Use non-capturing parentheses for the subexpressions used with 
`scan-assembler-times', to avoid a quirk with double-counting.

	gcc/testsuite/
	* gcc.target/arm/pr53447-5.c: Use non-capturing parentheses with 
	`scan-assembler-times'.
---
Hi,

 The `scan-assembler-times' quirk is being fixed with
<https://gcc.gnu.org/pipermail/gcc-patches/2023-November/637254.html>, but 
we don't need capturing parentheses here, typically used for back 
references, so let's just avoid the quirk altogether and make our matching 
here work either way.  Cf. commit 88c888f11379 ("pr53447-5.c: Fix test 
expectations for neon-fpu.").

 Verified by proof-reading, with a reference to the commit quoted above.  
OK to apply?

  Maciej
---
 gcc/testsuite/gcc.target/arm/pr53447-5.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

gcc-arm-test-pr53447-5-non-capturing.diff

Comments

Richard Earnshaw Nov. 22, 2023, 9:41 a.m. UTC | #1
On 22/11/2023 01:40, Maciej W. Rozycki wrote:
> Use non-capturing parentheses for the subexpressions used with
> `scan-assembler-times', to avoid a quirk with double-counting.
> 
>          gcc/testsuite/
>          * gcc.target/arm/pr53447-5.c: Use non-capturing parentheses with
>          `scan-assembler-times'.
> ---
> Hi,
> 
>   The `scan-assembler-times' quirk is being fixed with
> <https://gcc.gnu.org/pipermail/gcc-patches/2023-November/637254.html 
> <https://gcc.gnu.org/pipermail/gcc-patches/2023-November/637254.html>>, but
> we don't need capturing parentheses here, typically used for back
> references, so let's just avoid the quirk altogether and make our matching
> here work either way.  Cf. commit 88c888f11379 ("pr53447-5.c: Fix test
> expectations for neon-fpu.").
> 
>   Verified by proof-reading, with a reference to the commit quoted above.
> OK to apply?
> 
>    Maciej
> ---
>   gcc/testsuite/gcc.target/arm/pr53447-5.c |    8 +++-----
>   1 file changed, 3 insertions(+), 5 deletions(-)
> 
> gcc-arm-test-pr53447-5-non-capturing.diff
> Index: gcc/gcc/testsuite/gcc.target/arm/pr53447-5.c
> ===================================================================
> --- gcc.orig/gcc/testsuite/gcc.target/arm/pr53447-5.c
> +++ gcc/gcc/testsuite/gcc.target/arm/pr53447-5.c
> @@ -15,8 +15,6 @@ void foo(long long* p)
>     p[9] -= p[10];
>   }
> 
> -/* We accept neon instructions vldr.64 and vstr.64 as well.
> -   Note: DejaGnu counts patterns with alternatives twice,
> -   so actually there are only 10 loads and 9 stores.  */
> -/* { dg-final { scan-assembler-times "(ldrd|vldr\\.64)" 20 } } */
> -/* { dg-final { scan-assembler-times "(strd|vstr\\.64)" 18 } } */
> +/* We accept neon instructions vldr.64 and vstr.64 as well.  */
> +/* { dg-final { scan-assembler-times "(?:ldrd|vldr\\.64)" 10 } } */
> +/* { dg-final { scan-assembler-times "(?:strd|vstr\\.64)" 9 } } */


OK.

Thanks.

R.
diff mbox series

Patch

Index: gcc/gcc/testsuite/gcc.target/arm/pr53447-5.c
===================================================================
--- gcc.orig/gcc/testsuite/gcc.target/arm/pr53447-5.c
+++ gcc/gcc/testsuite/gcc.target/arm/pr53447-5.c
@@ -15,8 +15,6 @@  void foo(long long* p)
   p[9] -= p[10];
 }
 
-/* We accept neon instructions vldr.64 and vstr.64 as well.
-   Note: DejaGnu counts patterns with alternatives twice,
-   so actually there are only 10 loads and 9 stores.  */
-/* { dg-final { scan-assembler-times "(ldrd|vldr\\.64)" 20 } } */
-/* { dg-final { scan-assembler-times "(strd|vstr\\.64)" 18 } } */
+/* We accept neon instructions vldr.64 and vstr.64 as well.  */
+/* { dg-final { scan-assembler-times "(?:ldrd|vldr\\.64)" 10 } } */
+/* { dg-final { scan-assembler-times "(?:strd|vstr\\.64)" 9 } } */