* [PATCH, committed] Testsuite, darwin: Fix analyzer testcases
@ 2023-08-20 18:05 FX Coudert
0 siblings, 0 replies; only message in thread
From: FX Coudert @ 2023-08-20 18:05 UTC (permalink / raw)
To: GCC Patches; +Cc: Iain Sandoe
[-- Attachment #1: Type: text/plain, Size: 492 bytes --]
Committed as obvious, fixing three more darwin-specific failures in analyzer testsuite.
This fixes:
FAIL: gcc.dg/plugin/taint-CVE-2011-0521-5.c -fplugin=./analyzer_kernel_plugin.so (test for warnings, line 39)
FAIL: gcc.dg/plugin/taint-CVE-2011-0521-6.c -fplugin=./analyzer_kernel_plugin.so (test for warnings, line 36)
XPASS: gcc.dg/plugin/taint-CVE-2011-0521-5-fixed.c -fplugin=./analyzer_kernel_plugin.so (test for bogus messages, line 39)
Committed to trunk,
FX
[-- Attachment #2: 0001-Testsuite-darwin-Fix-analyzer-testcases.patch --]
[-- Type: application/octet-stream, Size: 2963 bytes --]
From 7694d0352a92d9f91c7afa69df0a0e56f95a771b Mon Sep 17 00:00:00 2001
From: Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Date: Sun, 20 Aug 2023 20:02:43 +0200
Subject: [PATCH] Testsuite, darwin: Fix analyzer testcases
On darwin, system headers are fortified by default and that defeats the
analyzer's warnings on memcpy() calls. Turn this off for testing.
gcc/testsuite/ChangeLog:
* gcc.dg/plugin/taint-CVE-2011-0521-5-fixed.c: Use
_FORTIFY_SOURCE=0 on darwin.
* gcc.dg/plugin/taint-CVE-2011-0521-5.c: Likewise.
* gcc.dg/plugin/taint-CVE-2011-0521-6.c: Likewise.
---
gcc/testsuite/gcc.dg/plugin/taint-CVE-2011-0521-5-fixed.c | 3 +++
gcc/testsuite/gcc.dg/plugin/taint-CVE-2011-0521-5.c | 3 +++
gcc/testsuite/gcc.dg/plugin/taint-CVE-2011-0521-6.c | 3 +++
3 files changed, 9 insertions(+)
diff --git a/gcc/testsuite/gcc.dg/plugin/taint-CVE-2011-0521-5-fixed.c b/gcc/testsuite/gcc.dg/plugin/taint-CVE-2011-0521-5-fixed.c
index 8cb067c6542..2e74770a7a3 100644
--- a/gcc/testsuite/gcc.dg/plugin/taint-CVE-2011-0521-5-fixed.c
+++ b/gcc/testsuite/gcc.dg/plugin/taint-CVE-2011-0521-5-fixed.c
@@ -4,6 +4,9 @@
/* { dg-options "-fanalyzer -fanalyzer-checker=taint --param=analyzer-max-svalue-depth=25" } */
/* { dg-require-effective-target analyzer } */
+/* On darwin, system headers are fortified, which defeats the analysis. Turn it off. */
+/* { dg-additional-options "-D_FORTIFY_SOURCE=0" { target *-*-darwin* } } */
+
/* See notes in this header. */
#include "taint-CVE-2011-0521.h"
diff --git a/gcc/testsuite/gcc.dg/plugin/taint-CVE-2011-0521-5.c b/gcc/testsuite/gcc.dg/plugin/taint-CVE-2011-0521-5.c
index 4ce047902d3..021d458b66e 100644
--- a/gcc/testsuite/gcc.dg/plugin/taint-CVE-2011-0521-5.c
+++ b/gcc/testsuite/gcc.dg/plugin/taint-CVE-2011-0521-5.c
@@ -4,6 +4,9 @@
/* { dg-options "-fanalyzer -fanalyzer-checker=taint --param=analyzer-max-svalue-depth=25" } */
/* { dg-require-effective-target analyzer } */
+/* On darwin, system headers are fortified, which defeats the analysis. Turn it off. */
+/* { dg-additional-options "-D_FORTIFY_SOURCE=0" { target *-*-darwin* } } */
+
/* See notes in this header. */
#include "taint-CVE-2011-0521.h"
diff --git a/gcc/testsuite/gcc.dg/plugin/taint-CVE-2011-0521-6.c b/gcc/testsuite/gcc.dg/plugin/taint-CVE-2011-0521-6.c
index c54af790a56..f27e9eb5f02 100644
--- a/gcc/testsuite/gcc.dg/plugin/taint-CVE-2011-0521-6.c
+++ b/gcc/testsuite/gcc.dg/plugin/taint-CVE-2011-0521-6.c
@@ -4,6 +4,9 @@
/* { dg-options "-fanalyzer -fanalyzer-checker=taint --param=analyzer-max-svalue-depth=25" } */
/* { dg-require-effective-target analyzer } */
+/* On darwin, system headers are fortified, which defeats the analysis. Turn it off. */
+/* { dg-additional-options "-D_FORTIFY_SOURCE=0" { target *-*-darwin* } } */
+
/* See notes in this header. */
#include "taint-CVE-2011-0521.h"
--
2.39.2 (Apple Git-143)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-08-20 18:06 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-20 18:05 [PATCH, committed] Testsuite, darwin: Fix analyzer testcases FX Coudert
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).