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.
This commit is contained in:
Francois-Xavier Coudert 2023-08-20 20:02:43 +02:00
parent 02393e4b5e
commit 7694d0352a
3 changed files with 9 additions and 0 deletions

View file

@ -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"

View file

@ -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"

View file

@ -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"