[committed,gcc-11] libstdc++: Fix testsuite failures with -O0
Checks
Commit Message
I've pushed this to gcc-11 after testing on x86_64-linux.
-- >8 --
Backport the prune.exp change from r12-4425-g1595fe44e11a96 to fix two
testsuite failures when testing with -O0:
FAIL: 20_util/uses_allocator/69293_neg.cc (test for excess errors)
FAIL: 20_util/uses_allocator/cons_neg.cc (test for excess errors)
Also force some 20_util/integer_comparisons/ xfail tests to use -O2 so
that the errors match the dg-error directives.
libstdc++-v3/ChangeLog:
* testsuite/20_util/integer_comparisons/greater_equal_neg.cc:
Add -O2 to dg-options.
* testsuite/20_util/integer_comparisons/greater_neg.cc:
Likewise.
* testsuite/20_util/integer_comparisons/less_equal_neg.cc:
Likewise.
* testsuite/lib/prune.exp: Prune 'in constexpr expansion'.
---
.../testsuite/20_util/integer_comparisons/greater_equal_neg.cc | 2 +-
.../testsuite/20_util/integer_comparisons/greater_neg.cc | 2 +-
.../testsuite/20_util/integer_comparisons/less_equal_neg.cc | 2 +-
libstdc++-v3/testsuite/lib/prune.exp | 1 +
4 files changed, 4 insertions(+), 3 deletions(-)
@@ -15,7 +15,7 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// { dg-options "-std=gnu++2a" }
+// { dg-options "-std=gnu++2a -O2" }
// { dg-do compile { target c++2a } }
#include <utility>
@@ -15,7 +15,7 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// { dg-options "-std=gnu++2a" }
+// { dg-options "-std=gnu++2a -O2" }
// { dg-do compile { target c++2a } }
#include <utility>
@@ -15,7 +15,7 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// { dg-options "-std=gnu++2a" }
+// { dg-options "-std=gnu++2a -O2" }
// { dg-do compile { target c++2a } }
#include <utility>
@@ -46,6 +46,7 @@ proc libstdc++-dg-prune { system text } {
regsub -all "(^|\n)\[^\n\]*(: )?At (top level|global scope):\[^\n\]*" $text "" text
regsub -all "(^|\n)\[^\n\]*: (recursively )?required \[^\n\]*" $text "" text
regsub -all "(^|\n)\[^\n\]*: . skipping \[0-9\]* instantiation contexts \[^\n\]*" $text "" text
+ regsub -all "(^|\n)\[^\n\]*: in .constexpr. expansion \[^\n\]*" $text "" text
regsub -all "(^|\n) inlined from \[^\n\]*" $text "" text
# Why doesn't GCC need these to strip header context?
regsub -all "(^|\n)In file included from \[^\n\]*" $text "" text