[Testsuite] Skip -fdelete-null-pointer-check tests if target keeps_null_pointer_checks
Checks
Commit Message
Hi,
When running regression tests related to https://gcc.gnu.org/pipermail/gcc-patches/2023-April/616772.html,
I noticed a bunch of failures because some tests explicitly pass in
-fdelete-null-pointer-checks, even if the target is configured to keep them.
This patch skips such failing tests by adding a dg-skip-if for keeps_null_pointer_checks.
Ok to commit?
Regards
Senthil
gcc/testsuite/ChangeLog:
* gcc.dg/attr-returns-nonnull.c: Skip if
keeps_null_pointer_checks.
* gcc.dg/init-compare-1.c: Likewise.
* gcc.dg/ipa/pr85734.c: Likewise.
* gcc.dg/ipa/propmalloc-1.c: Likewise.
* gcc.dg/ipa/propmalloc-2.c: Likewise.
* gcc.dg/ipa/propmalloc-3.c: Likewise.
* gcc.dg/ipa/propmalloc-4.c: Likewise.
* gcc.dg/tree-ssa/evrp11.c: Likewise.
* gcc.dg/tree-ssa/pr83648.c: Likewise.
Comments
On 5/14/23 23:06, SenthilKumar.Selvaraj--- via Gcc-patches wrote:
> Hi,
>
> When running regression tests related to https://gcc.gnu.org/pipermail/gcc-patches/2023-April/616772.html,
> I noticed a bunch of failures because some tests explicitly pass in
> -fdelete-null-pointer-checks, even if the target is configured to keep them.
>
> This patch skips such failing tests by adding a dg-skip-if for keeps_null_pointer_checks.
> Ok to commit?
>
> Regards
> Senthil
>
> gcc/testsuite/ChangeLog:
>
> * gcc.dg/attr-returns-nonnull.c: Skip if
> keeps_null_pointer_checks.
> * gcc.dg/init-compare-1.c: Likewise.
> * gcc.dg/ipa/pr85734.c: Likewise.
> * gcc.dg/ipa/propmalloc-1.c: Likewise.
> * gcc.dg/ipa/propmalloc-2.c: Likewise.
> * gcc.dg/ipa/propmalloc-3.c: Likewise.
> * gcc.dg/ipa/propmalloc-4.c: Likewise.
> * gcc.dg/tree-ssa/evrp11.c: Likewise.
> * gcc.dg/tree-ssa/pr83648.c: Likewise.
OK.
jeff
@@ -1,7 +1,8 @@
/* Verify that attribute returns_nonnull on global and local function
declarations is merged.
{ dg-do compile }
- { dg-options "-Wall -fdump-tree-optimized -fdelete-null-pointer-checks" } */
+ { dg-options "-Wall -fdump-tree-optimized -fdelete-null-pointer-checks" }
+ { dg-skip-if "" keeps_null_pointer_checks } */
void foo (void);
@@ -1,5 +1,6 @@
/* { dg-do compile } */
/* { dg-additional-options "-fdelete-null-pointer-checks" } */
+/* { dg-skip-if "" keeps_null_pointer_checks } */
extern int a, b;
int c = &a == &a;
@@ -1,5 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O2 -Wsuggest-attribute=malloc -fdelete-null-pointer-checks" } */
+/* { dg-skip-if "" keeps_null_pointer_checks } */
__attribute__((noinline))
static void *f1(__SIZE_TYPE__ sz) /* { dg-bogus "function might be candidate for attribute 'malloc'" } */
@@ -1,5 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-ipa-pure-const-details -fdelete-null-pointer-checks" } */
+/* { dg-skip-if "" keeps_null_pointer_checks } */
__attribute__((noinline, no_icf, used))
static void *f(__SIZE_TYPE__ n)
@@ -1,5 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-ipa-pure-const-details -fdelete-null-pointer-checks" } */
+/* { dg-skip-if "" keeps_null_pointer_checks } */
__attribute__((noinline, used, no_icf))
static void *foo (__SIZE_TYPE__ n)
@@ -1,5 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-ipa-pure-const-details -fdelete-null-pointer-checks" } */
+/* { dg-skip-if "" keeps_null_pointer_checks } */
static void *foo(__SIZE_TYPE__, int) __attribute__((noinline, no_icf, used));
@@ -1,5 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-local-pure-const-details -fdelete-null-pointer-checks" } */
+/* { dg-skip-if "" keeps_null_pointer_checks } */
void *foo(int cond1, int cond2, int cond3)
{
@@ -1,5 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-evrp -fdelete-null-pointer-checks" } */
+/* { dg-skip-if "" keeps_null_pointer_checks } */
extern void link_error ();
@@ -1,5 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-local-pure-const-details -fdelete-null-pointer-checks" } */
+/* { dg-skip-if "" keeps_null_pointer_checks } */
void *g(unsigned n)
{,