public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Hans-Peter Nilsson <hp@axis.com>
To: David Malcolm <dmalcolm@redhat.com>
Cc: <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] testsuite: Handle default_packed targets in gcc.dg/plugin
Date: Fri, 17 Mar 2023 17:10:47 +0100	[thread overview]
Message-ID: <20230317161047.9F7CE2040E@pchp3.se.axis.com> (raw)
In-Reply-To: <ae8db0dbe1da9d00a42295206ed8a64b7a954b59.camel@redhat.com> (message from David Malcolm on Thu, 16 Mar 2023 14:42:58 -0400)

> From: David Malcolm <dmalcolm@redhat.com>
> Date: Thu, 16 Mar 2023 14:42:58 -0400

> I think I prefer the top one-liner dg-skip-if approach you mentioned in
> your original email; it seems simplest.

Ok then.  There's also a choice between adding a
target-specifier (i.e. "{ target { ! default_packed } }") to
the dg-compile line, but a dg-skip-if is somewhat more
scalable and can, like here, be a bit more informative.

This is what I'll commit, as "testsuite: Skip some
gcc.dg/plugin tests for default_packed targets":

Avoid unweildy structure-layout-specific message-matching
expressions by exluding targets that lay out structures as
if they had been specified with __attribute__ ((__packed__)),
for tests where multiple messages depend on the structure
layout.

It's arguably a judgement call whether to skip some of these
tests or add multiple lines of matches depending on the
layout of structures.

	* gcc.dg/plugin/infoleak-2.c,
	gcc.dg/plugin/infoleak-CVE-2011-1078-1.c,
	gcc.dg/plugin/infoleak-CVE-2011-1078-2.c,
	gcc.dg/plugin/infoleak-CVE-2017-18549-1.c,
	gcc.dg/plugin/infoleak-CVE-2017-18550-1.c,
	gcc.dg/plugin/infoleak-antipatterns-1.c,
	gcc.dg/plugin/infoleak-fixit-1.c: Skip for default_packed targets.
---
 gcc/testsuite/gcc.dg/plugin/infoleak-2.c                | 1 +
 gcc/testsuite/gcc.dg/plugin/infoleak-CVE-2011-1078-1.c  | 1 +
 gcc/testsuite/gcc.dg/plugin/infoleak-CVE-2011-1078-2.c  | 1 +
 gcc/testsuite/gcc.dg/plugin/infoleak-CVE-2017-18549-1.c | 1 +
 gcc/testsuite/gcc.dg/plugin/infoleak-CVE-2017-18550-1.c | 1 +
 gcc/testsuite/gcc.dg/plugin/infoleak-antipatterns-1.c   | 1 +
 gcc/testsuite/gcc.dg/plugin/infoleak-fixit-1.c          | 1 +
 7 files changed, 7 insertions(+)

diff --git a/gcc/testsuite/gcc.dg/plugin/infoleak-2.c b/gcc/testsuite/gcc.dg/plugin/infoleak-2.c
index 252f8f25918a..43ab41b8a97b 100644
--- a/gcc/testsuite/gcc.dg/plugin/infoleak-2.c
+++ b/gcc/testsuite/gcc.dg/plugin/infoleak-2.c
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-fanalyzer" } */
 /* { dg-require-effective-target analyzer } */
+/* { dg-skip-if "structure layout assumption not met" { default_packed } } */
 
 #include <string.h>
 
diff --git a/gcc/testsuite/gcc.dg/plugin/infoleak-CVE-2011-1078-1.c b/gcc/testsuite/gcc.dg/plugin/infoleak-CVE-2011-1078-1.c
index 3616fbe176b3..8afce8eefac2 100644
--- a/gcc/testsuite/gcc.dg/plugin/infoleak-CVE-2011-1078-1.c
+++ b/gcc/testsuite/gcc.dg/plugin/infoleak-CVE-2011-1078-1.c
@@ -9,6 +9,7 @@
 /* { dg-do compile } */
 /* { dg-options "-fanalyzer" } */
 /* { dg-require-effective-target analyzer } */
+/* { dg-skip-if "structure layout assumption not met" { default_packed } } */
 
 #include <string.h>
 
diff --git a/gcc/testsuite/gcc.dg/plugin/infoleak-CVE-2011-1078-2.c b/gcc/testsuite/gcc.dg/plugin/infoleak-CVE-2011-1078-2.c
index 2096bda71798..1142cf22655a 100644
--- a/gcc/testsuite/gcc.dg/plugin/infoleak-CVE-2011-1078-2.c
+++ b/gcc/testsuite/gcc.dg/plugin/infoleak-CVE-2011-1078-2.c
@@ -3,6 +3,7 @@
 /* { dg-do compile } */
 /* { dg-options "-fanalyzer" } */
 /* { dg-require-effective-target analyzer } */
+/* { dg-skip-if "structure layout assumption not met" { default_packed } } */
 
 #include <string.h>
 
diff --git a/gcc/testsuite/gcc.dg/plugin/infoleak-CVE-2017-18549-1.c b/gcc/testsuite/gcc.dg/plugin/infoleak-CVE-2017-18549-1.c
index 8a1c816cc1b5..239c7d1df5d3 100644
--- a/gcc/testsuite/gcc.dg/plugin/infoleak-CVE-2017-18549-1.c
+++ b/gcc/testsuite/gcc.dg/plugin/infoleak-CVE-2017-18549-1.c
@@ -10,6 +10,7 @@
 /* { dg-do compile } */
 /* { dg-options "-fanalyzer" } */
 /* { dg-require-effective-target analyzer } */
+/* { dg-skip-if "structure layout assumption not met" { default_packed } } */
 
 #include <string.h>
 
diff --git a/gcc/testsuite/gcc.dg/plugin/infoleak-CVE-2017-18550-1.c b/gcc/testsuite/gcc.dg/plugin/infoleak-CVE-2017-18550-1.c
index 4272da96bab0..449348a1017f 100644
--- a/gcc/testsuite/gcc.dg/plugin/infoleak-CVE-2017-18550-1.c
+++ b/gcc/testsuite/gcc.dg/plugin/infoleak-CVE-2017-18550-1.c
@@ -10,6 +10,7 @@
 /* { dg-do compile } */
 /* { dg-options "-fanalyzer" } */
 /* { dg-require-effective-target analyzer } */
+/* { dg-skip-if "structure layout assumption not met" { default_packed } } */
 
 #include <string.h>
 
diff --git a/gcc/testsuite/gcc.dg/plugin/infoleak-antipatterns-1.c b/gcc/testsuite/gcc.dg/plugin/infoleak-antipatterns-1.c
index 500845364388..84789a7f157e 100644
--- a/gcc/testsuite/gcc.dg/plugin/infoleak-antipatterns-1.c
+++ b/gcc/testsuite/gcc.dg/plugin/infoleak-antipatterns-1.c
@@ -3,6 +3,7 @@
 /* { dg-do compile } */
 /* { dg-options "-fanalyzer" } */
 /* { dg-require-effective-target analyzer } */
+/* { dg-skip-if "structure layout assumption not met" { default_packed } } */
 
 typedef unsigned char u8;
 typedef unsigned __INT16_TYPE__ u16;
diff --git a/gcc/testsuite/gcc.dg/plugin/infoleak-fixit-1.c b/gcc/testsuite/gcc.dg/plugin/infoleak-fixit-1.c
index 6961b44f76b9..56158c12520a 100644
--- a/gcc/testsuite/gcc.dg/plugin/infoleak-fixit-1.c
+++ b/gcc/testsuite/gcc.dg/plugin/infoleak-fixit-1.c
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-fanalyzer" } */
 /* { dg-require-effective-target analyzer } */
+/* { dg-skip-if "structure layout assumption not met" { default_packed } } */
 
 #include <string.h>
 
-- 
2.30.2


  reply	other threads:[~2023-03-17 16:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-09 18:56 Hans-Peter Nilsson
2023-03-16 15:29 ` Ping: " Hans-Peter Nilsson
2023-03-16 17:55 ` David Malcolm
2023-03-16 18:25   ` Hans-Peter Nilsson
2023-03-16 18:42     ` David Malcolm
2023-03-17 16:10       ` Hans-Peter Nilsson [this message]
2023-03-17 16:43         ` David Malcolm
2023-03-16 18:45     ` Hans-Peter Nilsson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230317161047.9F7CE2040E@pchp3.se.axis.com \
    --to=hp@axis.com \
    --cc=dmalcolm@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).