[3/4] testsuite: Relax pattern to include "packed" targets

Message ID 20200720163106.27849-4-dimitar@dinux.eu
State New
Headers show
Series
  • testsuite: Add markers for default_packed targets
Related show

Commit Message

Dimitar Dimitrov July 20, 2020, 4:31 p.m.
The actual warning message depends on the default alignment of the
target. With this update the test correctly passes on AVR and PRU
targets.

gcc/testsuite/ChangeLog:

	* gcc.dg/pr53037-1.c: Relax warning pattern.

Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>

---
 gcc/testsuite/gcc.dg/pr53037-1.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
2.20.1

Comments

Richard Sandiford July 20, 2020, 5:56 p.m. | #1
Dimitar Dimitrov <dimitar@dinux.eu> writes:
> The actual warning message depends on the default alignment of the

> target. With this update the test correctly passes on AVR and PRU

> targets.

>

> gcc/testsuite/ChangeLog:

>

> 	* gcc.dg/pr53037-1.c: Relax warning pattern.

>

> Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>

> ---

>  gcc/testsuite/gcc.dg/pr53037-1.c | 4 ++--

>  1 file changed, 2 insertions(+), 2 deletions(-)

>

> diff --git a/gcc/testsuite/gcc.dg/pr53037-1.c b/gcc/testsuite/gcc.dg/pr53037-1.c

> index 3ea5ae6a34e..b4e9049c746 100644

> --- a/gcc/testsuite/gcc.dg/pr53037-1.c

> +++ b/gcc/testsuite/gcc.dg/pr53037-1.c

> @@ -40,7 +40,7 @@ struct foo5

>  {

>    int i1;

>    int x __attribute__((warn_if_not_aligned(16))); /* { dg-warning "'x' offset 4 in 'struct foo5' isn't aligned to 16" } */

> -}; /* { dg-warning "alignment 4 of 'struct foo5' is less than 16" } */

> +}; /* { dg-warning "alignment .* of 'struct foo5' is less than 16" } */

>  

>  struct foo6

>  {

> @@ -73,7 +73,7 @@ union bar3

>  {

>    int i1;

>    int x __attribute__((warn_if_not_aligned(16))); 

> -}; /* { dg-warning "alignment 4 of 'union bar3' is less than 16" } */

> +}; /* { dg-warning "alignment .* of 'union bar3' is less than 16" } */


Better to use [0-9]+, and change the quoting to {…} rather than "…"
so that there's no need to add backslashes for the [ and ].

OK with that change, thanks.

Richard

Patch

diff --git a/gcc/testsuite/gcc.dg/pr53037-1.c b/gcc/testsuite/gcc.dg/pr53037-1.c
index 3ea5ae6a34e..b4e9049c746 100644
--- a/gcc/testsuite/gcc.dg/pr53037-1.c
+++ b/gcc/testsuite/gcc.dg/pr53037-1.c
@@ -40,7 +40,7 @@  struct foo5
 {
   int i1;
   int x __attribute__((warn_if_not_aligned(16))); /* { dg-warning "'x' offset 4 in 'struct foo5' isn't aligned to 16" } */
-}; /* { dg-warning "alignment 4 of 'struct foo5' is less than 16" } */
+}; /* { dg-warning "alignment .* of 'struct foo5' is less than 16" } */
 
 struct foo6
 {
@@ -73,7 +73,7 @@  union bar3
 {
   int i1;
   int x __attribute__((warn_if_not_aligned(16))); 
-}; /* { dg-warning "alignment 4 of 'union bar3' is less than 16" } */
+}; /* { dg-warning "alignment .* of 'union bar3' is less than 16" } */
 
 union bar4
 {