From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp1.axis.com (smtp1.axis.com [195.60.68.17]) by sourceware.org (Postfix) with ESMTPS id 771413858D28 for ; Fri, 17 Mar 2023 16:10:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 771413858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=axis.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=axis.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; q=dns/txt; s=axis-central1; t=1679069449; x=1710605449; h=from:to:cc:in-reply-to:subject:mime-version: content-transfer-encoding:references:message-id:date; bh=Ke2QYqZl4uqjVd7AaYv2jZswvTjbCfraxidHX8GqdLY=; b=RJLur0EIEHVsg1nJ1hGYB2IIAeS8Q3CHNVg7P13U7blBN2r/KJcZNGx7 Atv4RFH8p2hhnTh4c0zddThPi08+MQWi+U9CDugJ+6da+qKGuS22ihsZ3 4NlKNsAXMwhF4rTj+d7i4XlN0qCmtx5aCuMHavHkhN7n6HeMWTHavCTHH 3hgjXrFu1mv5/GtN2Vwz1tsoCiT2OMz3w6k8JBZsI9YS4EAh9Zg06xSYQ UpxRHV0bVoSXheINrcaCwh/e0Kd8Se/6IandK4cxPkRK7tukm7ZXIyd7P 8nfIWppT7wZWpaaG3EDLBzZnaSKdvV64KPaK70vZnGYNHeCdLvylq/Mz6 g==; From: Hans-Peter Nilsson To: David Malcolm CC: In-Reply-To: (message from David Malcolm on Thu, 16 Mar 2023 14:42:58 -0400) Subject: Re: [PATCH] testsuite: Handle default_packed targets in gcc.dg/plugin MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8BIT References: <20230309185616.E420F20438@pchp3.se.axis.com> <20230316182505.7EBB1203D2@pchp3.se.axis.com> Message-ID: <20230317161047.9F7CE2040E@pchp3.se.axis.com> Date: Fri, 17 Mar 2023 17:10:47 +0100 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: > From: David Malcolm > 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 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 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 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 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 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 -- 2.30.2