Testsuite: Make dependence on -fdelete-null-pointer-checks explicit

nios2-elf target defaults to -fno-delete-null-pointer-checks, breaking
tests that implicitly depend on that optimization.  Add the option
explicitly on these tests.

2022-01-08  Sandra Loosemore  <sandra@codesourcery.com>

	gcc/testsuite/
	* g++.dg/cpp0x/constexpr-compare1.C: Add explicit
	-fdelete-null-pointer-checks option.
	* g++.dg/cpp0x/constexpr-compare2.C: Likewise.
	* g++.dg/cpp0x/constexpr-typeid2.C: Likewise.
	* g++.dg/cpp1y/constexpr-94716.C: Likewise.
	* g++.dg/cpp1z/constexpr-compare1.C: Likewise.
	* g++.dg/cpp1z/constexpr-if36.C: Likewise.
	* gcc.dg/init-compare-1.c: Likewise.

	libstdc++-v3/
	* testsuite/18_support/type_info/constexpr.cc: Add explicit
	-fdelete-null-pointer-checks option.
This commit is contained in:
Sandra Loosemore 2022-01-08 22:02:13 -08:00
parent 2848ef1411
commit 57fe1f6ad3
8 changed files with 8 additions and 0 deletions

View File

@ -1,4 +1,5 @@
// { dg-do compile { target c++11 } }
// { dg-additional-options "-fdelete-null-pointer-checks" }
extern int a, b;
static_assert (&a == &a, "");

View File

@ -1,5 +1,6 @@
// PR c++/69681
// { dg-do compile { target c++11 } }
// { dg-additional-options "-fdelete-null-pointer-checks" }
void f();
void g();

View File

@ -1,5 +1,6 @@
// PR c++/103600
// { dg-do compile { target c++11 } }
// { dg-additional-options "-fdelete-null-pointer-checks" }
#include <typeinfo>

View File

@ -1,5 +1,6 @@
// PR c++/94716
// { dg-do compile { target c++14 } }
// { dg-additional-options "-fdelete-null-pointer-checks" }
template <int> char v = 0;
static_assert (&v<2> == &v<2>, "");

View File

@ -1,4 +1,5 @@
// { dg-do compile { target c++17 } }
// { dg-additional-options "-fdelete-null-pointer-checks" }
inline int a = 0;
inline int b = 0;

View File

@ -3,6 +3,7 @@
// weakness.
// { dg-do compile { target c++17 } }
// { dg-additional-options "-fdelete-null-pointer-checks" }
extern void weakfn1 (void);
extern void weakfn2 (void);

View File

@ -1,4 +1,5 @@
/* { dg-do compile } */
/* { dg-additional-options "-fdelete-null-pointer-checks" } */
extern int a, b;
int c = &a == &a;

View File

@ -1,5 +1,6 @@
// { dg-options "-std=gnu++23 -frtti" }
// { dg-do compile { target c++23 } }
// { dg-additional-options "-fdelete-null-pointer-checks" }
#include <typeinfo>