]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite: add some missing -fanalyzer to plugin tests
authorDavid Malcolm <dmalcolm@redhat.com>
Wed, 10 Apr 2024 20:43:27 +0000 (16:43 -0400)
committerDavid Malcolm <dmalcolm@redhat.com>
Wed, 10 Apr 2024 20:43:27 +0000 (16:43 -0400)
gcc/testsuite/ChangeLog:
* gcc.dg/plugin/copy_from_user-1.c: Add missing directives for an
analyzer test.
* gcc.dg/plugin/taint-CVE-2011-0521-1-fixed.c: Add missing
-fanalyzer to options.
* gcc.dg/plugin/taint-CVE-2011-0521-1.c: Likewise.
* gcc.dg/plugin/taint-CVE-2011-0521-2-fixed.c: Likewise.
(dvb_usercopy): Add default case to avoid complaints about NULL
derefs.
* gcc.dg/plugin/taint-CVE-2011-0521-2.c: Likewise.
* gcc.dg/plugin/taint-CVE-2011-0521-3-fixed.c: Add missing
-fanalyzer to options.
* gcc.dg/plugin/taint-CVE-2011-0521-3.c: Likewise.  Drop
xfail.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
gcc/testsuite/gcc.dg/plugin/copy_from_user-1.c
gcc/testsuite/gcc.dg/plugin/taint-CVE-2011-0521-1-fixed.c
gcc/testsuite/gcc.dg/plugin/taint-CVE-2011-0521-1.c
gcc/testsuite/gcc.dg/plugin/taint-CVE-2011-0521-2-fixed.c
gcc/testsuite/gcc.dg/plugin/taint-CVE-2011-0521-2.c
gcc/testsuite/gcc.dg/plugin/taint-CVE-2011-0521-3-fixed.c
gcc/testsuite/gcc.dg/plugin/taint-CVE-2011-0521-3.c

index a1415f38aa6578d111a7b19f918ad31de3a22c07..1acedc2e2ce8a77fd9d32d796f3a69b5cf800e40 100644 (file)
@@ -1,3 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-fanalyzer" } */
+/* { dg-require-effective-target analyzer } */
+
 typedef __SIZE_TYPE__ size_t;
 
 #define __user
index 51526b831c02b8158ec6722ca81b9f079154e382..9ad05ff670a228f0bbe1bac47f4384f3829ddc0e 100644 (file)
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-require-effective-target analyzer } */
-/* { dg-additional-options "-Wno-pedantic" } */
+/* { dg-additional-options "-fanalyzer -Wno-pedantic" } */
 
 /* See notes in this header.  */
 #include "taint-CVE-2011-0521.h"
index 3d11a75073c1e203f59918949974a448e6eff2b7..688d014956ecb389037e7fef25b40378315f6c8f 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-additional-options "-Wno-pedantic" } */
+/* { dg-additional-options "-fanalyzer -Wno-pedantic" } */
 /* { dg-require-effective-target analyzer } */
 
 /* See notes in this header.  */
index d035266b16ade5068c9e444155ab88a2fa8319b9..7e597037ec244fec487c454fc7ac80fa2713e067 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-additional-options "-Wno-pedantic" } */
+/* { dg-additional-options "-fanalyzer -Wno-pedantic" } */
 /* { dg-require-effective-target analyzer } */
 
 /* See notes in this header.  */
@@ -67,6 +67,8 @@ int dvb_usercopy(struct file *file,
                if (copy_from_user(parg, (void __user *)arg, _IOC_SIZE(cmd)))
                        goto out;
                break;
+       default:
+               goto out;
        }
 
        /* call driver */
index 5270e22f1a320a98c845f2bf136d97e2fe2c89f9..9189cdb2c37cff4ae3a61e5259c3e97cf4224b46 100644 (file)
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-require-effective-target analyzer } */
-/* { dg-additional-options "-Wno-pedantic" } */
+/* { dg-additional-options "-fanalyzer -Wno-pedantic" } */
 
 /* See notes in this header.  */
 #include "taint-CVE-2011-0521.h"
@@ -67,6 +67,8 @@ int dvb_usercopy(struct file *file,
                if (copy_from_user(parg, (void __user *)arg, _IOC_SIZE(cmd)))
                        goto out;
                break;
+       default:
+               goto out;
        }
 
        /* call driver */
index b8268fa4a826af42d9996b580b512e2361b1ffbe..d10ce28b40e275485f5ab9ccc70637463f242aa0 100644 (file)
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-require-effective-target analyzer } */
-/* { dg-additional-options "-Wno-pedantic" } */
+/* { dg-additional-options "-fanalyzer -Wno-pedantic" } */
 
 /* See notes in this header.  */
 #include "taint-CVE-2011-0521.h"
index 86868a017c4c4637a0427b3370db723fb04de049..5185ffd223d0ae1c6eaeded4d3ae580500d14e3c 100644 (file)
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-require-effective-target analyzer } */
-/* { dg-additional-options "-Wno-pedantic" } */
+/* { dg-additional-options "-fanalyzer -Wno-pedantic" } */
 
 /* See notes in this header.  */
 #include "taint-CVE-2011-0521.h"
@@ -19,8 +19,7 @@ int dvb_ca_ioctl(struct file *file, unsigned int cmd, void *parg)
 
                if (info->num > 1)
                        return -EINVAL;
-               av7110->ci_slot[info->num].num = info->num; /* { dg-warning "attacker-controlled value" "" { xfail *-*-* } } */
-               /* TODO(xfail).  */
+               av7110->ci_slot[info->num].num = info->num; /* { dg-warning "attacker-controlled value" } */
                av7110->ci_slot[info->num].type = FW_CI_LL_SUPPORT(av7110->arm_app) ?
                                                        CA_CI_LINK : CA_CI;
                memcpy(info, &av7110->ci_slot[info->num], sizeof(ca_slot_info_t));