Add -fdelete-null-pointer-checks to some C++ testcases.
authorSandra Loosemore <sandra@codesourcery.com>
Fri, 24 Jan 2020 19:41:31 +0000 (11:41 -0800)
committerSandra Loosemore <sandra@codesourcery.com>
Fri, 24 Jan 2020 19:41:31 +0000 (11:41 -0800)
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.

18 files changed:
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/constexpr-odr1.C
gcc/testsuite/g++.dg/cpp0x/constexpr-odr2.C
gcc/testsuite/g++.dg/cpp0x/nontype4.C
gcc/testsuite/g++.dg/cpp1y/constexpr-new.C
gcc/testsuite/g++.dg/cpp1y/new1.C
gcc/testsuite/g++.dg/cpp1y/new2.C
gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic11.C
gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic17.C
gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic4.C
gcc/testsuite/g++.dg/cpp2a/constexpr-new1.C
gcc/testsuite/g++.dg/cpp2a/constexpr-new10.C
gcc/testsuite/g++.dg/cpp2a/constexpr-new2.C
gcc/testsuite/g++.dg/cpp2a/constexpr-new3.C
gcc/testsuite/g++.dg/cpp2a/constexpr-new4.C
gcc/testsuite/g++.dg/cpp2a/constexpr-new8.C
gcc/testsuite/g++.dg/cpp2a/constexpr-new9.C
gcc/testsuite/g++.dg/cpp2a/nontype-class1.C

index ed277a4de51a4ed9aa1749a22f740c6451a20287..7c6b4cdfa6c8021b39c1bbe502fd91a349c5dee2 100644 (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):
index cf3f95f0565c30de0d62f382c9eab8e584956108..d00baae74521e268205baa1ef43a5f92766c0982 100644 (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;
index 0927488e5695f31cd57b5d6bda397006961c775c..dd569a96ba672c721286b8a3ab67f0fe4e199b32 100644 (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;
index 2c552d0029326d73f75a448e312e2831e5973645..b6a1ae7fc9bd954236c1bc9222df4ebc70cad044 100644 (file)
@@ -1,5 +1,6 @@
 // PR c++/56428
 // { dg-do compile { target c++11 } }
+// { dg-additional-options "-fdelete-null-pointer-checks" }
 
 struct A { };
 
index 6316ff24bbc2059187b397fa5b6dbee1788353b4..d0ca0b7d27f7998e780a41d49b69641bda22f4f1 100644 (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) {
index b9ad64dfcc0db938158006f3a9f9699d7b1c3010..7016951b46fc5c7e3b347cf97ba017fbb8229958 100644 (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>
 
index 926e79605283e92879b94e9bbee8b7bf348bf75a..97f4001d5d737988e46c38d7c1bf0698c1a20360 100644 (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>
index 6069fbfd01ce158c3ec83fb5e988234d6b305e9b..8dfa03a9cd59f9f3d178260db616e67b37ceb8f9 100644 (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
index 6b443d249ec7e4ac083dc14d67fc2aba6efd434a..c574e75510393473b5edb6bfd675f68db73b5b91 100644 (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
index 3adc524379d7e2d53e6250809fca1755e7a83413..6f42d20ec4143bea6ede7f5bc86fd6d5247f4740 100644 (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.
 
index 873edd4d2313a83ae2db402e9020d850691a6835..5d1b7ef10192967734fbff3ceb91e7391277087d 100644 (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; };
 
index 500a3240c8feba5fad2efaa88fb89f7b2119b145..bc5e6e5c78a9fdc989f93930c64cdbc5ad189dd2 100644 (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} {}
index be5496293b6a74a18a30e2fc4225dc39b1a39990..d3733e831b63edff05fd920f7a207266716b0c17 100644 (file)
@@ -1,5 +1,6 @@
 // P0784R7
 // { dg-do compile { target c++2a } }
+// { dg-additional-options "-fdelete-null-pointer-checks" }
 
 template <int N>
 constexpr bool
index 3380df74468f1ef5f0d054ee02e19b19807f792c..6e7880adcb204909e8c1c57669774370f8fd576a 100644 (file)
@@ -1,5 +1,6 @@
 // P0784R7
 // { dg-do compile { target c++2a } }
+// { dg-additional-options "-fdelete-null-pointer-checks" }
 
 constexpr int *
 f1 ()
index 6cac9835463fd9eab5a2985894fea19992d01a38..b9bd5ea19c176acd24d6f24296bd7b4664bac514 100644 (file)
@@ -1,5 +1,6 @@
 // P0784R7
 // { dg-do compile { target c++2a } }
+// { dg-additional-options "-fdelete-null-pointer-checks" }
 
 struct S
 {
index c9c852dfc37a777276b91acb79226112a76d1ef1..f13da10443900c99c53f49dc36addcea99d7c237 100644 (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} {}
index 552d3c1b1cf4f5f71c06eb6d5e55e22ea941b213..f99f0808f7c32c6475dd74fa67cb27620f202401 100644 (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} {}
index 0c0b94d22c03fb87a8eafbaad7f29544341bc7ca..a3334fc7d480f5a1f5f1aa1a9db244dd8b42db3d 100644 (file)
@@ -1,4 +1,5 @@
 // { dg-do compile { target c++2a } }
+// { dg-additional-options "-fdelete-null-pointer-checks" }
 
 struct A
 {