From: Sandra Loosemore Date: Fri, 24 Jan 2020 19:41:31 +0000 (-0800) Subject: Add -fdelete-null-pointer-checks to some C++ testcases. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7c75a2a3bfdcc2fc792d730562c677d513347d1c;p=gcc.git 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 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. --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ed277a4de51..7c6b4cdfa6c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,23 @@ +2020-01-24 Sandra Loosemore + + * 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 * lib/target-supports.exp (check_effective_target_unsigned_char): diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-odr1.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-odr1.C index cf3f95f0565..d00baae7452 100644 --- a/gcc/testsuite/g++.dg/cpp0x/constexpr-odr1.C +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-odr1.C @@ -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 struct A { static const bool x; diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-odr2.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-odr2.C index 0927488e569..dd569a96ba6 100644 --- a/gcc/testsuite/g++.dg/cpp0x/constexpr-odr2.C +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-odr2.C @@ -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 struct A { static const bool x; diff --git a/gcc/testsuite/g++.dg/cpp0x/nontype4.C b/gcc/testsuite/g++.dg/cpp0x/nontype4.C index 2c552d00293..b6a1ae7fc9b 100644 --- a/gcc/testsuite/g++.dg/cpp0x/nontype4.C +++ b/gcc/testsuite/g++.dg/cpp0x/nontype4.C @@ -1,5 +1,6 @@ // PR c++/56428 // { dg-do compile { target c++11 } } +// { dg-additional-options "-fdelete-null-pointer-checks" } struct A { }; diff --git a/gcc/testsuite/g++.dg/cpp1y/constexpr-new.C b/gcc/testsuite/g++.dg/cpp1y/constexpr-new.C index 6316ff24bbc..d0ca0b7d27f 100644 --- a/gcc/testsuite/g++.dg/cpp1y/constexpr-new.C +++ b/gcc/testsuite/g++.dg/cpp1y/constexpr-new.C @@ -1,4 +1,5 @@ // { dg-do compile { target c++14 } } +// { dg-additional-options "-fdelete-null-pointer-checks" } constexpr int *f4(bool b) { if (b) { diff --git a/gcc/testsuite/g++.dg/cpp1y/new1.C b/gcc/testsuite/g++.dg/cpp1y/new1.C index b9ad64dfcc0..7016951b46f 100644 --- a/gcc/testsuite/g++.dg/cpp1y/new1.C +++ b/gcc/testsuite/g++.dg/cpp1y/new1.C @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2 -fdump-tree-cddce-details" } */ +// { dg-additional-options "-fdelete-null-pointer-checks" } #include diff --git a/gcc/testsuite/g++.dg/cpp1y/new2.C b/gcc/testsuite/g++.dg/cpp1y/new2.C index 926e7960528..97f4001d5d7 100644 --- a/gcc/testsuite/g++.dg/cpp1y/new2.C +++ b/gcc/testsuite/g++.dg/cpp1y/new2.C @@ -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 #include diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic11.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic11.C index 6069fbfd01c..8dfa03a9cd5 100644 --- a/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic11.C +++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic11.C @@ -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 diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic17.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic17.C index 6b443d249ec..c574e755103 100644 --- a/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic17.C +++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic17.C @@ -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 diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic4.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic4.C index 3adc524379d..6f42d20ec41 100644 --- a/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic4.C +++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic4.C @@ -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. diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-new1.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-new1.C index 873edd4d231..5d1b7ef1019 100644 --- a/gcc/testsuite/g++.dg/cpp2a/constexpr-new1.C +++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-new1.C @@ -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; }; diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-new10.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-new10.C index 500a3240c8f..bc5e6e5c78a 100644 --- a/gcc/testsuite/g++.dg/cpp2a/constexpr-new10.C +++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-new10.C @@ -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} {} diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-new2.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-new2.C index be5496293b6..d3733e831b6 100644 --- a/gcc/testsuite/g++.dg/cpp2a/constexpr-new2.C +++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-new2.C @@ -1,5 +1,6 @@ // P0784R7 // { dg-do compile { target c++2a } } +// { dg-additional-options "-fdelete-null-pointer-checks" } template constexpr bool diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-new3.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-new3.C index 3380df74468..6e7880adcb2 100644 --- a/gcc/testsuite/g++.dg/cpp2a/constexpr-new3.C +++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-new3.C @@ -1,5 +1,6 @@ // P0784R7 // { dg-do compile { target c++2a } } +// { dg-additional-options "-fdelete-null-pointer-checks" } constexpr int * f1 () diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-new4.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-new4.C index 6cac9835463..b9bd5ea19c1 100644 --- a/gcc/testsuite/g++.dg/cpp2a/constexpr-new4.C +++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-new4.C @@ -1,5 +1,6 @@ // P0784R7 // { dg-do compile { target c++2a } } +// { dg-additional-options "-fdelete-null-pointer-checks" } struct S { diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-new8.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-new8.C index c9c852dfc37..f13da104439 100644 --- a/gcc/testsuite/g++.dg/cpp2a/constexpr-new8.C +++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-new8.C @@ -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} {} diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-new9.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-new9.C index 552d3c1b1cf..f99f0808f7c 100644 --- a/gcc/testsuite/g++.dg/cpp2a/constexpr-new9.C +++ b/gcc/testsuite/g++.dg/cpp2a/constexpr-new9.C @@ -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} {} diff --git a/gcc/testsuite/g++.dg/cpp2a/nontype-class1.C b/gcc/testsuite/g++.dg/cpp2a/nontype-class1.C index 0c0b94d22c0..a3334fc7d48 100644 --- a/gcc/testsuite/g++.dg/cpp2a/nontype-class1.C +++ b/gcc/testsuite/g++.dg/cpp2a/nontype-class1.C @@ -1,4 +1,5 @@ // { dg-do compile { target c++2a } } +// { dg-additional-options "-fdelete-null-pointer-checks" } struct A {