[committed,3/5] libstdc++: Add dg-require-effective-target to std::span assert tests

Message ID 20200731190109.GA1313139@redhat.com
State New
Headers show
Series
  • [committed,1/5] libstdc++: Ensure c++NN effective target present in all C++17 tests
Related show

Commit Message

Jonathan Wakely via Gcc-patches July 31, 2020, 7:01 p.m.
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.

Tested powerpc64le-linux, committed to trunk.
commit a92e0f58d83eff14bd95cf655903debb1d1a03ad
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Jul 31 19:58:02 2020

    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.

Patch

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 @@ 
 // <http://www.gnu.org/licenses/>.
 
 // { 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 @@ 
 // <http://www.gnu.org/licenses/>.
 
 // { 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 @@ 
 // <http://www.gnu.org/licenses/>.
 
 // { 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 @@ 
 // <http://www.gnu.org/licenses/>.
 
 // { 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 @@ 
 // <http://www.gnu.org/licenses/>.
 
 // { 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 @@ 
 // <http://www.gnu.org/licenses/>.
 
 // { 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 @@ 
 // <http://www.gnu.org/licenses/>.
 
 // { 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 @@ 
 // <http://www.gnu.org/licenses/>.
 
 // { 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 @@ 
 // <http://www.gnu.org/licenses/>.
 
 // { 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 @@ 
 // <http://www.gnu.org/licenses/>.
 
 // { 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 @@ 
 // <http://www.gnu.org/licenses/>.
 
 // { 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 @@ 
 // <http://www.gnu.org/licenses/>.
 
 // { 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 @@ 
 // <http://www.gnu.org/licenses/>.
 
 // { 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