aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorFrancois-Xavier Coudert <fxcoudert@gcc.gnu.org>2023-08-20 20:02:43 +0200
committerFrancois-Xavier Coudert <fxcoudert@gcc.gnu.org>2023-08-20 20:02:43 +0200
commit7694d0352a92d9f91c7afa69df0a0e56f95a771b (patch)
tree7f79bcacc90b6080c55b74ae488470fe8920ea4a /gcc
parent02393e4b5eabe1c64720b022cb6f819e7b4dc08b (diff)
downloadgcc-7694d0352a92d9f91c7afa69df0a0e56f95a771b.zip
gcc-7694d0352a92d9f91c7afa69df0a0e56f95a771b.tar.gz
gcc-7694d0352a92d9f91c7afa69df0a0e56f95a771b.tar.bz2
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.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/gcc.dg/plugin/taint-CVE-2011-0521-5-fixed.c3
-rw-r--r--gcc/testsuite/gcc.dg/plugin/taint-CVE-2011-0521-5.c3
-rw-r--r--gcc/testsuite/gcc.dg/plugin/taint-CVE-2011-0521-6.c3
3 files changed, 9 insertions, 0 deletions
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 8cb067c..2e74770 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 4ce0479..021d458 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 c54af79..f27e9eb 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"