[Testsuite] Skip -fdelete-null-pointer-check tests if target keeps_null_pointer_checks

Message ID 595B4378-CEDC-4D6D-A6B1-7FF80AFEF7B0@microchip.com
State Not Applicable
Headers
Series [Testsuite] Skip -fdelete-null-pointer-check tests if target keeps_null_pointer_checks |

Checks

Context Check Description
snail/gcc-patch-check fail Git am fail log

Commit Message

Li, Pan2 via Gcc-patches May 15, 2023, 5:06 a.m. UTC
  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

Jeff Law May 16, 2023, 4:34 a.m. UTC | #1
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
  

Patch

diff --git gcc/testsuite/gcc.dg/attr-returns-nonnull.c gcc/testsuite/gcc.dg/attr-returns-nonnull.c
index e4e20b8..d7f39be 100644
--- gcc/testsuite/gcc.dg/attr-returns-nonnull.c
+++ gcc/testsuite/gcc.dg/attr-returns-nonnull.c
@@ -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);
 
diff --git gcc/testsuite/gcc.dg/init-compare-1.c gcc/testsuite/gcc.dg/init-compare-1.c
index 6737c85..a473f59 100644
--- gcc/testsuite/gcc.dg/init-compare-1.c
+++ gcc/testsuite/gcc.dg/init-compare-1.c
@@ -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;
diff --git gcc/testsuite/gcc.dg/ipa/pr85734.c gcc/testsuite/gcc.dg/ipa/pr85734.c
index cbd524b..b3f5c81 100644
--- gcc/testsuite/gcc.dg/ipa/pr85734.c
+++ gcc/testsuite/gcc.dg/ipa/pr85734.c
@@ -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'" } */
diff --git gcc/testsuite/gcc.dg/ipa/propmalloc-1.c gcc/testsuite/gcc.dg/ipa/propmalloc-1.c
index d7c13af..f5e8676 100644
--- gcc/testsuite/gcc.dg/ipa/propmalloc-1.c
+++ gcc/testsuite/gcc.dg/ipa/propmalloc-1.c
@@ -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)
diff --git gcc/testsuite/gcc.dg/ipa/propmalloc-2.c gcc/testsuite/gcc.dg/ipa/propmalloc-2.c
index 2332d9a..e26af41 100644
--- gcc/testsuite/gcc.dg/ipa/propmalloc-2.c
+++ gcc/testsuite/gcc.dg/ipa/propmalloc-2.c
@@ -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)
diff --git gcc/testsuite/gcc.dg/ipa/propmalloc-3.c gcc/testsuite/gcc.dg/ipa/propmalloc-3.c
index 5386695..3329a99 100644
--- gcc/testsuite/gcc.dg/ipa/propmalloc-3.c
+++ gcc/testsuite/gcc.dg/ipa/propmalloc-3.c
@@ -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));
 
diff --git gcc/testsuite/gcc.dg/ipa/propmalloc-4.c gcc/testsuite/gcc.dg/ipa/propmalloc-4.c
index 9552b73..23566e6 100644
--- gcc/testsuite/gcc.dg/ipa/propmalloc-4.c
+++ gcc/testsuite/gcc.dg/ipa/propmalloc-4.c
@@ -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)
 {
diff --git gcc/testsuite/gcc.dg/tree-ssa/evrp11.c gcc/testsuite/gcc.dg/tree-ssa/evrp11.c
index d791305..018aded 100644
--- gcc/testsuite/gcc.dg/tree-ssa/evrp11.c
+++ gcc/testsuite/gcc.dg/tree-ssa/evrp11.c
@@ -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 ();
 
diff --git gcc/testsuite/gcc.dg/tree-ssa/pr83648.c gcc/testsuite/gcc.dg/tree-ssa/pr83648.c
index 954eb2f..d3dd12d 100644
--- gcc/testsuite/gcc.dg/tree-ssa/pr83648.c
+++ gcc/testsuite/gcc.dg/tree-ssa/pr83648.c
@@ -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)
 {,