public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] testsuite: Silence analyzer/pr51628-30.c for default_packed
@ 2022-05-08  7:31 Dimitar Dimitrov
  2022-05-09 12:53 ` David Malcolm
  0 siblings, 1 reply; 2+ messages in thread
From: Dimitar Dimitrov @ 2022-05-08  7:31 UTC (permalink / raw)
  To: gcc-patches

On default_packed targets like PRU, a warning in the file included from
analyzer/pr51628-30.c is reported as spurious one, even though it has been
annotated there:

  Excess errors:
  gcc/gcc/testsuite/gcc.dg/analyzer/torture/../../../c-c++-common/pr51628-30.c:7:19: warning: 'packed' attribute ignored for field of type 'struct B' [-Wattributes]

DejaGnu does not preprocess the C test case sources.  Hence the "dg-*"
statements in included files are ignored.

Mark that gcc.dg/analyzer/torture/pr51628-30.c generates excess warnings
for default_packed targets.  This is safe because the original test case
covered an ICE, not a diagnostic error.

Ok for trunk?

gcc/testsuite/ChangeLog:

	* gcc.dg/analyzer/torture/pr51628-30.c: Test can spill excess
	errors for default_packed targets.

CC: David Malcolm <dmalcolm@redhat.com>
Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
---
 gcc/testsuite/gcc.dg/analyzer/torture/pr51628-30.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gcc/testsuite/gcc.dg/analyzer/torture/pr51628-30.c b/gcc/testsuite/gcc.dg/analyzer/torture/pr51628-30.c
index 4513e0f890c..abc13413f2b 100644
--- a/gcc/testsuite/gcc.dg/analyzer/torture/pr51628-30.c
+++ b/gcc/testsuite/gcc.dg/analyzer/torture/pr51628-30.c
@@ -1,3 +1,4 @@
 /* { dg-additional-options "-Wno-address-of-packed-member" } */
+/* { dg-excess-errors "warnings about ignored 'packed' attribute" { target default_packed } } */
 
 #include "../../../c-c++-common/pr51628-30.c"
-- 
2.35.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] testsuite: Silence analyzer/pr51628-30.c for default_packed
  2022-05-08  7:31 [PATCH] testsuite: Silence analyzer/pr51628-30.c for default_packed Dimitar Dimitrov
@ 2022-05-09 12:53 ` David Malcolm
  0 siblings, 0 replies; 2+ messages in thread
From: David Malcolm @ 2022-05-09 12:53 UTC (permalink / raw)
  To: Dimitar Dimitrov, gcc-patches

On Sun, 2022-05-08 at 10:31 +0300, Dimitar Dimitrov wrote:
> On default_packed targets like PRU, a warning in the file included
> from
> analyzer/pr51628-30.c is reported as spurious one, even though it has
> been
> annotated there:
> 
>   Excess errors:
>   gcc/gcc/testsuite/gcc.dg/analyzer/torture/../../../c-c++-
> common/pr51628-30.c:7:19: warning: 'packed' attribute ignored for
> field of type 'struct B' [-Wattributes]
> 
> DejaGnu does not preprocess the C test case sources.  Hence the "dg-
> *"
> statements in included files are ignored.
> 
> Mark that gcc.dg/analyzer/torture/pr51628-30.c generates excess
> warnings
> for default_packed targets.  This is safe because the original test
> case
> covered an ICE, not a diagnostic error.

Indeed; for reference, the ICE was part of PR analyzer/93388 (part of
ensuring that -fanalyzer doesn't ICE on less common tree codes).

> 
> Ok for trunk?

Thanks; looks good to me.  Sorry about the noise.

Dave

> 
> gcc/testsuite/ChangeLog:
> 
>         * gcc.dg/analyzer/torture/pr51628-30.c: Test can spill excess
>         errors for default_packed targets.
> 
> CC: David Malcolm <dmalcolm@redhat.com>
> Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
> ---
>  gcc/testsuite/gcc.dg/analyzer/torture/pr51628-30.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/gcc/testsuite/gcc.dg/analyzer/torture/pr51628-30.c
> b/gcc/testsuite/gcc.dg/analyzer/torture/pr51628-30.c
> index 4513e0f890c..abc13413f2b 100644
> --- a/gcc/testsuite/gcc.dg/analyzer/torture/pr51628-30.c
> +++ b/gcc/testsuite/gcc.dg/analyzer/torture/pr51628-30.c
> @@ -1,3 +1,4 @@
>  /* { dg-additional-options "-Wno-address-of-packed-member" } */
> +/* { dg-excess-errors "warnings about ignored 'packed' attribute" {
> target default_packed } } */
>  
>  #include "../../../c-c++-common/pr51628-30.c"



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-05-09 12:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-08  7:31 [PATCH] testsuite: Silence analyzer/pr51628-30.c for default_packed Dimitar Dimitrov
2022-05-09 12:53 ` David Malcolm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).