From a92e0f58d83eff14bd95cf655903debb1d1a03ad Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Fri, 31 Jul 2020 19:58:02 +0100 Subject: [PATCH] libstdc++: Add dg-require-effective-target to std::span assert tests The current dg directives say that the tests can run for any standard mode, but should fail for C++20. What we want is that they only run for C++20, and are always expected to fail. libstdc++-v3/ChangeLog: * testsuite/23_containers/span/back_assert_neg.cc: Split c++2a effective-target from xfail selector. * testsuite/23_containers/span/first_2_assert_neg.cc: Likewise. * testsuite/23_containers/span/first_assert_neg.cc: Likewise. * testsuite/23_containers/span/front_assert_neg.cc: Likewise. * testsuite/23_containers/span/index_op_assert_neg.cc: Likewise. * testsuite/23_containers/span/last_2_assert_neg.cc: Likewise. * testsuite/23_containers/span/last_assert_neg.cc: Likewise. * testsuite/23_containers/span/subspan_2_assert_neg.cc: Likewise. * testsuite/23_containers/span/subspan_3_assert_neg.cc: Likewise. * testsuite/23_containers/span/subspan_4_assert_neg.cc: Likewise. * testsuite/23_containers/span/subspan_5_assert_neg.cc: Likewise. * testsuite/23_containers/span/subspan_6_assert_neg.cc: Likewise. * testsuite/23_containers/span/subspan_assert_neg.cc: Likewise. --- libstdc++-v3/testsuite/23_containers/span/back_assert_neg.cc | 3 ++- .../testsuite/23_containers/span/first_2_assert_neg.cc | 3 ++- libstdc++-v3/testsuite/23_containers/span/first_assert_neg.cc | 3 ++- libstdc++-v3/testsuite/23_containers/span/front_assert_neg.cc | 3 ++- .../testsuite/23_containers/span/index_op_assert_neg.cc | 3 ++- libstdc++-v3/testsuite/23_containers/span/last_2_assert_neg.cc | 3 ++- libstdc++-v3/testsuite/23_containers/span/last_assert_neg.cc | 3 ++- .../testsuite/23_containers/span/subspan_2_assert_neg.cc | 3 ++- .../testsuite/23_containers/span/subspan_3_assert_neg.cc | 3 ++- .../testsuite/23_containers/span/subspan_4_assert_neg.cc | 3 ++- .../testsuite/23_containers/span/subspan_5_assert_neg.cc | 3 ++- .../testsuite/23_containers/span/subspan_6_assert_neg.cc | 3 ++- .../testsuite/23_containers/span/subspan_assert_neg.cc | 3 ++- 13 files changed, 26 insertions(+), 13 deletions(-) diff --git a/libstdc++-v3/testsuite/23_containers/span/back_assert_neg.cc b/libstdc++-v3/testsuite/23_containers/span/back_assert_neg.cc index 76f2a7eb286..f536f91deee 100644 --- a/libstdc++-v3/testsuite/23_containers/span/back_assert_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/span/back_assert_neg.cc @@ -16,7 +16,8 @@ // . // { dg-options "-std=gnu++2a" } -// { dg-do run { xfail c++2a } } +// { dg-do run { xfail *-*-* } } +// { dg-require-effective-target c++2a } #undef _GLIBCXX_ASSERTIONS #define _GLIBCXX_ASSERTIONS diff --git a/libstdc++-v3/testsuite/23_containers/span/first_2_assert_neg.cc b/libstdc++-v3/testsuite/23_containers/span/first_2_assert_neg.cc index 0019fca5b8b..d959e5c8d1a 100644 --- a/libstdc++-v3/testsuite/23_containers/span/first_2_assert_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/span/first_2_assert_neg.cc @@ -16,7 +16,8 @@ // . // { dg-options "-std=gnu++2a" } -// { dg-do run { xfail c++2a } } +// { dg-do run { xfail *-*-* } } +// { dg-require-effective-target c++2a } #undef _GLIBCXX_ASSERTIONS #define _GLIBCXX_ASSERTIONS diff --git a/libstdc++-v3/testsuite/23_containers/span/first_assert_neg.cc b/libstdc++-v3/testsuite/23_containers/span/first_assert_neg.cc index 7b93abc9a92..096f78c6405 100644 --- a/libstdc++-v3/testsuite/23_containers/span/first_assert_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/span/first_assert_neg.cc @@ -16,7 +16,8 @@ // . // { dg-options "-std=gnu++2a" } -// { dg-do run { xfail c++2a } } +// { dg-do run { xfail *-*-* } } +// { dg-require-effective-target c++2a } #undef _GLIBCXX_ASSERTIONS #define _GLIBCXX_ASSERTIONS diff --git a/libstdc++-v3/testsuite/23_containers/span/front_assert_neg.cc b/libstdc++-v3/testsuite/23_containers/span/front_assert_neg.cc index 62dec39c6a0..8687f18a87f 100644 --- a/libstdc++-v3/testsuite/23_containers/span/front_assert_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/span/front_assert_neg.cc @@ -16,7 +16,8 @@ // . // { dg-options "-std=gnu++2a" } -// { dg-do run { xfail c++2a } } +// { dg-do run { xfail *-*-* } } +// { dg-require-effective-target c++2a } #undef _GLIBCXX_ASSERTIONS #define _GLIBCXX_ASSERTIONS diff --git a/libstdc++-v3/testsuite/23_containers/span/index_op_assert_neg.cc b/libstdc++-v3/testsuite/23_containers/span/index_op_assert_neg.cc index 10432ebe72f..595e5888ccc 100644 --- a/libstdc++-v3/testsuite/23_containers/span/index_op_assert_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/span/index_op_assert_neg.cc @@ -16,7 +16,8 @@ // . // { dg-options "-std=gnu++2a" } -// { dg-do run { xfail c++2a } } +// { dg-do run { xfail *-*-* } } +// { dg-require-effective-target c++2a } #undef _GLIBCXX_ASSERTIONS #define _GLIBCXX_ASSERTIONS diff --git a/libstdc++-v3/testsuite/23_containers/span/last_2_assert_neg.cc b/libstdc++-v3/testsuite/23_containers/span/last_2_assert_neg.cc index cc12c1f540e..5f990d923b9 100644 --- a/libstdc++-v3/testsuite/23_containers/span/last_2_assert_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/span/last_2_assert_neg.cc @@ -16,7 +16,8 @@ // . // { dg-options "-std=gnu++2a" } -// { dg-do run { xfail c++2a } } +// { dg-do run { xfail *-*-* } } +// { dg-require-effective-target c++2a } #undef _GLIBCXX_ASSERTIONS #define _GLIBCXX_ASSERTIONS diff --git a/libstdc++-v3/testsuite/23_containers/span/last_assert_neg.cc b/libstdc++-v3/testsuite/23_containers/span/last_assert_neg.cc index 773bea49e57..9f3b4c20017 100644 --- a/libstdc++-v3/testsuite/23_containers/span/last_assert_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/span/last_assert_neg.cc @@ -16,7 +16,8 @@ // . // { dg-options "-std=gnu++2a" } -// { dg-do run { xfail c++2a } } +// { dg-do run { xfail *-*-* } } +// { dg-require-effective-target c++2a } #undef _GLIBCXX_ASSERTIONS #define _GLIBCXX_ASSERTIONS diff --git a/libstdc++-v3/testsuite/23_containers/span/subspan_2_assert_neg.cc b/libstdc++-v3/testsuite/23_containers/span/subspan_2_assert_neg.cc index a3b856ecd67..9a2d8f5cd91 100644 --- a/libstdc++-v3/testsuite/23_containers/span/subspan_2_assert_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/span/subspan_2_assert_neg.cc @@ -16,7 +16,8 @@ // . // { dg-options "-std=gnu++2a" } -// { dg-do run { xfail c++2a } } +// { dg-do run { xfail *-*-* } } +// { dg-require-effective-target c++2a } #undef _GLIBCXX_ASSERTIONS #define _GLIBCXX_ASSERTIONS diff --git a/libstdc++-v3/testsuite/23_containers/span/subspan_3_assert_neg.cc b/libstdc++-v3/testsuite/23_containers/span/subspan_3_assert_neg.cc index 2c559427094..81dff2878b9 100644 --- a/libstdc++-v3/testsuite/23_containers/span/subspan_3_assert_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/span/subspan_3_assert_neg.cc @@ -16,7 +16,8 @@ // . // { dg-options "-std=gnu++2a" } -// { dg-do run { xfail c++2a } } +// { dg-do run { xfail *-*-* } } +// { dg-require-effective-target c++2a } #undef _GLIBCXX_ASSERTIONS #define _GLIBCXX_ASSERTIONS diff --git a/libstdc++-v3/testsuite/23_containers/span/subspan_4_assert_neg.cc b/libstdc++-v3/testsuite/23_containers/span/subspan_4_assert_neg.cc index 8a082633bf1..b8cd9a41a57 100644 --- a/libstdc++-v3/testsuite/23_containers/span/subspan_4_assert_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/span/subspan_4_assert_neg.cc @@ -16,7 +16,8 @@ // . // { dg-options "-std=gnu++2a" } -// { dg-do run { xfail c++2a } } +// { dg-do run { xfail *-*-* } } +// { dg-require-effective-target c++2a } #undef _GLIBCXX_ASSERTIONS #define _GLIBCXX_ASSERTIONS diff --git a/libstdc++-v3/testsuite/23_containers/span/subspan_5_assert_neg.cc b/libstdc++-v3/testsuite/23_containers/span/subspan_5_assert_neg.cc index c3836478b66..94a2b2c11d9 100644 --- a/libstdc++-v3/testsuite/23_containers/span/subspan_5_assert_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/span/subspan_5_assert_neg.cc @@ -16,7 +16,8 @@ // . // { dg-options "-std=gnu++2a" } -// { dg-do run { xfail c++2a } } +// { dg-do run { xfail *-*-* } } +// { dg-require-effective-target c++2a } #undef _GLIBCXX_ASSERTIONS #define _GLIBCXX_ASSERTIONS diff --git a/libstdc++-v3/testsuite/23_containers/span/subspan_6_assert_neg.cc b/libstdc++-v3/testsuite/23_containers/span/subspan_6_assert_neg.cc index a58d763ea9d..4a30e358504 100644 --- a/libstdc++-v3/testsuite/23_containers/span/subspan_6_assert_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/span/subspan_6_assert_neg.cc @@ -16,7 +16,8 @@ // . // { dg-options "-std=gnu++2a" } -// { dg-do run { xfail c++2a } } +// { dg-do run { xfail *-*-* } } +// { dg-require-effective-target c++2a } #undef _GLIBCXX_ASSERTIONS #define _GLIBCXX_ASSERTIONS diff --git a/libstdc++-v3/testsuite/23_containers/span/subspan_assert_neg.cc b/libstdc++-v3/testsuite/23_containers/span/subspan_assert_neg.cc index 9160489382a..57c1b6f1f1b 100644 --- a/libstdc++-v3/testsuite/23_containers/span/subspan_assert_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/span/subspan_assert_neg.cc @@ -16,7 +16,8 @@ // . // { dg-options "-std=gnu++2a" } -// { dg-do run { xfail c++2a } } +// { dg-do run { xfail *-*-* } } +// { dg-require-effective-target c++2a } #undef _GLIBCXX_ASSERTIONS #define _GLIBCXX_ASSERTIONS -- 2.30.2