Add -fdelete-null-pointer-checks to some C++ testcases.

These testcases were failing on nios2-elf, which defaults to
-fno-delete-null-pointer-checks.

2020-01-24  Sandra Loosemore  <sandra@codesourcery.com>

	gcc/testsuite/
	* g++.dg/cpp0x/constexpr-odr1.C: Add -fdelete-null-pointer-checks.
	* g++.dg/cpp0x/constexpr-odr2.C: Likewise.
	* g++.dg/cpp0x/nontype4.C: Likewise.
	* g++.dg/cpp1y/constexpr-new.C: Likewise.
	* g++.dg/cpp1y/new1.C: Likewise.
	* g++.dg/cpp1y/new2.C: Likewise.
	* g++.dg/cpp2a/constexpr-dynamic11.C: Likewise.
	* g++.dg/cpp2a/constexpr-dynamic17.C: Likewise.
	* g++.dg/cpp2a/constexpr-dynamic4.C: Likewise.
	* g++.dg/cpp2a/constexpr-new1.C: Likewise.
	* g++.dg/cpp2a/constexpr-new10.C: Likewise.
	* g++.dg/cpp2a/constexpr-new2.C: Likewise.
	* g++.dg/cpp2a/constexpr-new3.C: Likewise.
	* g++.dg/cpp2a/constexpr-new4.C: Likewise.
	* g++.dg/cpp2a/constexpr-new8.C: Likewise.
	* g++.dg/cpp2a/constexpr-new9.C: Likewise.
	* g++.dg/cpp2a/nontype-class1.C: Likewise.
This commit is contained in:
Sandra Loosemore 2020-01-24 11:41:31 -08:00
parent 28a5d5c365
commit 7c75a2a3bf
18 changed files with 37 additions and 0 deletions

View file

@ -1,3 +1,23 @@
2020-01-24 Sandra Loosemore <sandra@codesourcery.com>
* g++.dg/cpp0x/constexpr-odr1.C: Add -fdelete-null-pointer-checks.
* g++.dg/cpp0x/constexpr-odr2.C: Likewise.
* g++.dg/cpp0x/nontype4.C: Likewise.
* g++.dg/cpp1y/constexpr-new.C: Likewise.
* g++.dg/cpp1y/new1.C: Likewise.
* g++.dg/cpp1y/new2.C: Likewise.
* g++.dg/cpp2a/constexpr-dynamic11.C: Likewise.
* g++.dg/cpp2a/constexpr-dynamic17.C: Likewise.
* g++.dg/cpp2a/constexpr-dynamic4.C: Likewise.
* g++.dg/cpp2a/constexpr-new1.C: Likewise.
* g++.dg/cpp2a/constexpr-new10.C: Likewise.
* g++.dg/cpp2a/constexpr-new2.C: Likewise.
* g++.dg/cpp2a/constexpr-new3.C: Likewise.
* g++.dg/cpp2a/constexpr-new4.C: Likewise.
* g++.dg/cpp2a/constexpr-new8.C: Likewise.
* g++.dg/cpp2a/constexpr-new9.C: Likewise.
* g++.dg/cpp2a/nontype-class1.C: Likewise.
2020-01-24 Jason Merrill <jason@redhat.com>
* lib/target-supports.exp (check_effective_target_unsigned_char):

View file

@ -1,5 +1,6 @@
// PR c++/92062 - ODR-use ignored for static member of class template.
// { dg-do run { target c++11 } }
// { dg-additional-options "-fdelete-null-pointer-checks" }
template<int> struct A {
static const bool x;

View file

@ -1,5 +1,6 @@
// PR c++/92062 - ODR-use ignored for static member of class template.
// { dg-do run { target c++11 } }
// { dg-additional-options "-fdelete-null-pointer-checks" }
template<int> struct A {
static const bool x;

View file

@ -1,5 +1,6 @@
// PR c++/56428
// { dg-do compile { target c++11 } }
// { dg-additional-options "-fdelete-null-pointer-checks" }
struct A { };

View file

@ -1,4 +1,5 @@
// { dg-do compile { target c++14 } }
// { dg-additional-options "-fdelete-null-pointer-checks" }
constexpr int *f4(bool b) {
if (b) {

View file

@ -1,5 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-cddce-details" } */
// { dg-additional-options "-fdelete-null-pointer-checks" }
#include <stdlib.h>

View file

@ -1,5 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O2 -std=c++17 -fdump-tree-cddce-details" } */
/* { dg-additional-options "-fdelete-null-pointer-checks" } */
#include <cstdio>
#include <cstdlib>

View file

@ -1,5 +1,6 @@
// PR c++/88337 - Implement P1327R1: Allow dynamic_cast/typeid in constexpr.
// { dg-do compile { target c++2a } }
// { dg-additional-options "-fdelete-null-pointer-checks" }
// dynamic_cast in a constructor.
// [class.cdtor]#6: "If the operand of the dynamic_cast refers to the object

View file

@ -1,5 +1,6 @@
// PR c++/88337 - Implement P1327R1: Allow dynamic_cast/typeid in constexpr.
// { dg-do compile { target c++2a } }
// { dg-additional-options "-fdelete-null-pointer-checks" }
// dynamic_cast in a constructor.
// [class.cdtor]#6: "If the operand of the dynamic_cast refers to the object

View file

@ -1,5 +1,6 @@
// PR c++/88337 - Implement P1327R1: Allow dynamic_cast/typeid in constexpr.
// { dg-do compile { target c++2a } }
// { dg-additional-options "-fdelete-null-pointer-checks" }
// From clang's constant-expression-cxx2a.cpp.

View file

@ -1,5 +1,6 @@
// P0784R7
// { dg-do compile { target c++2a } }
// { dg-additional-options "-fdelete-null-pointer-checks" }
struct S { constexpr S () : s (5) {} constexpr S (int x) : s (x) {} int s; };

View file

@ -1,5 +1,6 @@
// PR c++/91369
// { dg-do compile { target c++2a } }
// { dg-additional-options "-fdelete-null-pointer-checks" }
struct S {
constexpr S (int* i) : s{i} {}

View file

@ -1,5 +1,6 @@
// P0784R7
// { dg-do compile { target c++2a } }
// { dg-additional-options "-fdelete-null-pointer-checks" }
template <int N>
constexpr bool

View file

@ -1,5 +1,6 @@
// P0784R7
// { dg-do compile { target c++2a } }
// { dg-additional-options "-fdelete-null-pointer-checks" }
constexpr int *
f1 ()

View file

@ -1,5 +1,6 @@
// P0784R7
// { dg-do compile { target c++2a } }
// { dg-additional-options "-fdelete-null-pointer-checks" }
struct S
{

View file

@ -1,5 +1,6 @@
// PR c++/91369
// { dg-do compile { target c++2a } }
// { dg-additional-options "-fdelete-null-pointer-checks" }
struct A {
constexpr A () : p{new int} {}

View file

@ -1,5 +1,6 @@
// PR c++/91369
// { dg-do compile { target c++2a } }
// { dg-additional-options "-fdelete-null-pointer-checks" }
struct S {
constexpr S (int *i) : i{i} {}

View file

@ -1,4 +1,5 @@
// { dg-do compile { target c++2a } }
// { dg-additional-options "-fdelete-null-pointer-checks" }
struct A
{