diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++2017/all_attributes.cc b/libstdc++-v3/testsuite/17_intro/headers/c++2017/all_attributes.cc
index ec81f745ef5b..035526e24cbe 100644
--- a/libstdc++-v3/testsuite/17_intro/headers/c++2017/all_attributes.cc
+++ b/libstdc++-v3/testsuite/17_intro/headers/c++2017/all_attributes.cc
@@ -16,7 +16,7 @@
// .
// { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
// Ensure the library only uses the __name__ form for attributes.
// Don't test 'const' and 'noreturn' because they are reserved anyway.
diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++2017/all_no_exceptions.cc b/libstdc++-v3/testsuite/17_intro/headers/c++2017/all_no_exceptions.cc
index 3821cea5b68b..0f6e581d71c5 100644
--- a/libstdc++-v3/testsuite/17_intro/headers/c++2017/all_no_exceptions.cc
+++ b/libstdc++-v3/testsuite/17_intro/headers/c++2017/all_no_exceptions.cc
@@ -1,5 +1,5 @@
-// { dg-do compile }
// { dg-options "-std=gnu++17 -fno-exceptions" }
+// { dg-do compile { target c++17 } }
// Copyright (C) 2015-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++2017/all_no_rtti.cc b/libstdc++-v3/testsuite/17_intro/headers/c++2017/all_no_rtti.cc
index 823aca95f48f..f1c59c95b0f5 100644
--- a/libstdc++-v3/testsuite/17_intro/headers/c++2017/all_no_rtti.cc
+++ b/libstdc++-v3/testsuite/17_intro/headers/c++2017/all_no_rtti.cc
@@ -1,5 +1,5 @@
-// { dg-do compile }
// { dg-options "-std=gnu++17 -fno-rtti" }
+// { dg-do compile { target c++17 } }
// Copyright (C) 2015-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++2017/all_pedantic_errors.cc b/libstdc++-v3/testsuite/17_intro/headers/c++2017/all_pedantic_errors.cc
index 7e4254301915..7db8ea0e0bc5 100644
--- a/libstdc++-v3/testsuite/17_intro/headers/c++2017/all_pedantic_errors.cc
+++ b/libstdc++-v3/testsuite/17_intro/headers/c++2017/all_pedantic_errors.cc
@@ -1,5 +1,5 @@
-// { dg-do compile }
// { dg-options "-std=gnu++17 -pedantic-errors" }
+// { dg-do compile { target c++17 } }
// Copyright (C) 2015-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++2017/operator_names.cc b/libstdc++-v3/testsuite/17_intro/headers/c++2017/operator_names.cc
index af61df2cad7a..07dc83a0abe2 100644
--- a/libstdc++-v3/testsuite/17_intro/headers/c++2017/operator_names.cc
+++ b/libstdc++-v3/testsuite/17_intro/headers/c++2017/operator_names.cc
@@ -1,5 +1,5 @@
-// { dg-do compile }
// { dg-options "-std=gnu++17 -fno-operator-names" }
+// { dg-do compile { target c++17 } }
// Copyright (C) 2015-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++2017/stdc++.cc b/libstdc++-v3/testsuite/17_intro/headers/c++2017/stdc++.cc
index 5b865df2f0cf..eccaa9c9e074 100644
--- a/libstdc++-v3/testsuite/17_intro/headers/c++2017/stdc++.cc
+++ b/libstdc++-v3/testsuite/17_intro/headers/c++2017/stdc++.cc
@@ -1,7 +1,7 @@
// FreeBSD wants warning clean system headers:
// { dg-options "-std=gnu++17" }
// { dg-additional-options "-Wall -Wsystem-headers" { target *-*-freebsd* *-*-dragonfly* } }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
// Copyright (C) 2015-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++2017/stdc++_multiple_inclusion.cc b/libstdc++-v3/testsuite/17_intro/headers/c++2017/stdc++_multiple_inclusion.cc
index bda75c9daab9..e3d53243f674 100644
--- a/libstdc++-v3/testsuite/17_intro/headers/c++2017/stdc++_multiple_inclusion.cc
+++ b/libstdc++-v3/testsuite/17_intro/headers/c++2017/stdc++_multiple_inclusion.cc
@@ -1,7 +1,7 @@
// FreeBSD wants warning clean system headers:
// { dg-options "-std=gnu++17" }
// { dg-additional-options "-Wall -Wsystem-headers" { target *-*-freebsd* *-*-dragonfly* } }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
// Copyright (C) 2015-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/18_support/uncaught_exceptions/uncaught_exceptions.cc b/libstdc++-v3/testsuite/18_support/uncaught_exceptions/uncaught_exceptions.cc
index 2b84e61aac83..05e60b4e1858 100644
--- a/libstdc++-v3/testsuite/18_support/uncaught_exceptions/uncaught_exceptions.cc
+++ b/libstdc++-v3/testsuite/18_support/uncaught_exceptions/uncaught_exceptions.cc
@@ -16,6 +16,7 @@
// .
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
#include
#include
diff --git a/libstdc++-v3/testsuite/19_diagnostics/error_code/is_error_code_v.cc b/libstdc++-v3/testsuite/19_diagnostics/error_code/is_error_code_v.cc
index a54edb1850d3..1451caf15cdc 100644
--- a/libstdc++-v3/testsuite/19_diagnostics/error_code/is_error_code_v.cc
+++ b/libstdc++-v3/testsuite/19_diagnostics/error_code/is_error_code_v.cc
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
// Copyright (C) 2014-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/20_util/any/assign/1.cc b/libstdc++-v3/testsuite/20_util/any/assign/1.cc
index 30d3d279d77d..0cbc002eb40a 100644
--- a/libstdc++-v3/testsuite/20_util/any/assign/1.cc
+++ b/libstdc++-v3/testsuite/20_util/any/assign/1.cc
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++17" }
-// { dg-do run }
+// { dg-do run { target c++17 } }
// Copyright (C) 2014-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/20_util/any/assign/2.cc b/libstdc++-v3/testsuite/20_util/any/assign/2.cc
index 988806f883b7..bd1aab454f6e 100644
--- a/libstdc++-v3/testsuite/20_util/any/assign/2.cc
+++ b/libstdc++-v3/testsuite/20_util/any/assign/2.cc
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++17" }
-// { dg-do run }
+// { dg-do run { target c++17 } }
// Copyright (C) 2014-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/20_util/any/assign/emplace.cc b/libstdc++-v3/testsuite/20_util/any/assign/emplace.cc
index a93a3521c172..672945cb3ee4 100644
--- a/libstdc++-v3/testsuite/20_util/any/assign/emplace.cc
+++ b/libstdc++-v3/testsuite/20_util/any/assign/emplace.cc
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++17" }
-// { dg-do run }
+// { dg-do run { target c++17 } }
// Copyright (C) 2016-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/20_util/any/assign/exception.cc b/libstdc++-v3/testsuite/20_util/any/assign/exception.cc
index 8bdf93759604..876ea16130dd 100644
--- a/libstdc++-v3/testsuite/20_util/any/assign/exception.cc
+++ b/libstdc++-v3/testsuite/20_util/any/assign/exception.cc
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++17" }
-// { dg-do run }
+// { dg-do run { target c++17 } }
// Copyright (C) 2016-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/20_util/any/assign/self.cc b/libstdc++-v3/testsuite/20_util/any/assign/self.cc
index 777da8b120b2..3d8b05cc5552 100644
--- a/libstdc++-v3/testsuite/20_util/any/assign/self.cc
+++ b/libstdc++-v3/testsuite/20_util/any/assign/self.cc
@@ -16,6 +16,7 @@
// .
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
#include
#include
diff --git a/libstdc++-v3/testsuite/20_util/any/cons/1.cc b/libstdc++-v3/testsuite/20_util/any/cons/1.cc
index f04b3080ca17..91be8183c7c2 100644
--- a/libstdc++-v3/testsuite/20_util/any/cons/1.cc
+++ b/libstdc++-v3/testsuite/20_util/any/cons/1.cc
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++17" }
-// { dg-do run }
+// { dg-do run { target c++17 } }
// Copyright (C) 2014-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/20_util/any/cons/2.cc b/libstdc++-v3/testsuite/20_util/any/cons/2.cc
index b9324fd6c646..36f6ec860884 100644
--- a/libstdc++-v3/testsuite/20_util/any/cons/2.cc
+++ b/libstdc++-v3/testsuite/20_util/any/cons/2.cc
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++17" }
-// { dg-do run }
+// { dg-do run { target c++17 } }
// Copyright (C) 2014-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/20_util/any/cons/aligned.cc b/libstdc++-v3/testsuite/20_util/any/cons/aligned.cc
index e6ccd7edbd83..e9ac91734c35 100644
--- a/libstdc++-v3/testsuite/20_util/any/cons/aligned.cc
+++ b/libstdc++-v3/testsuite/20_util/any/cons/aligned.cc
@@ -16,6 +16,7 @@
// .
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// { dg-require-cstdint "" }
#include
diff --git a/libstdc++-v3/testsuite/20_util/any/cons/explicit.cc b/libstdc++-v3/testsuite/20_util/any/cons/explicit.cc
index 54824eb84183..b9e124fe6d83 100644
--- a/libstdc++-v3/testsuite/20_util/any/cons/explicit.cc
+++ b/libstdc++-v3/testsuite/20_util/any/cons/explicit.cc
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
// Copyright (C) 2016-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/20_util/any/cons/in_place.cc b/libstdc++-v3/testsuite/20_util/any/cons/in_place.cc
index 856e270e3e6c..ca92901aa61c 100644
--- a/libstdc++-v3/testsuite/20_util/any/cons/in_place.cc
+++ b/libstdc++-v3/testsuite/20_util/any/cons/in_place.cc
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++17" }
-// { dg-do run }
+// { dg-do run { target c++17 } }
// Copyright (C) 2016-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/20_util/any/cons/nontrivial.cc b/libstdc++-v3/testsuite/20_util/any/cons/nontrivial.cc
index 1a348b9ffddf..e6a7ed38861a 100644
--- a/libstdc++-v3/testsuite/20_util/any/cons/nontrivial.cc
+++ b/libstdc++-v3/testsuite/20_util/any/cons/nontrivial.cc
@@ -16,6 +16,7 @@
// .
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
#include
#include
diff --git a/libstdc++-v3/testsuite/20_util/any/make_any.cc b/libstdc++-v3/testsuite/20_util/any/make_any.cc
index 31b859bfe8d1..c75743d24657 100644
--- a/libstdc++-v3/testsuite/20_util/any/make_any.cc
+++ b/libstdc++-v3/testsuite/20_util/any/make_any.cc
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++17" }
-// { dg-do run }
+// { dg-do run { target c++17 } }
// Copyright (C) 2016-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/20_util/any/misc/any_cast.cc b/libstdc++-v3/testsuite/20_util/any/misc/any_cast.cc
index 180bbefa2130..7ca11d857f78 100644
--- a/libstdc++-v3/testsuite/20_util/any/misc/any_cast.cc
+++ b/libstdc++-v3/testsuite/20_util/any/misc/any_cast.cc
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++17" }
-// { dg-do run }
+// { dg-do run { target c++17 } }
// Copyright (C) 2014-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/20_util/any/misc/any_cast_no_rtti.cc b/libstdc++-v3/testsuite/20_util/any/misc/any_cast_no_rtti.cc
index bfc2d7cd7a21..e53e219e7dc0 100644
--- a/libstdc++-v3/testsuite/20_util/any/misc/any_cast_no_rtti.cc
+++ b/libstdc++-v3/testsuite/20_util/any/misc/any_cast_no_rtti.cc
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++17 -fno-rtti" }
-// { dg-do run }
+// { dg-do run { target c++17 } }
// Copyright (C) 2014-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/20_util/any/misc/swap.cc b/libstdc++-v3/testsuite/20_util/any/misc/swap.cc
index 73ca265e42d9..1aaf5fb0b990 100644
--- a/libstdc++-v3/testsuite/20_util/any/misc/swap.cc
+++ b/libstdc++-v3/testsuite/20_util/any/misc/swap.cc
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++17" }
-// { dg-do run }
+// { dg-do run { target c++17 } }
// Copyright (C) 2014-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/20_util/any/modifiers/1.cc b/libstdc++-v3/testsuite/20_util/any/modifiers/1.cc
index 9fb5a6b0158d..aacd96493ff3 100644
--- a/libstdc++-v3/testsuite/20_util/any/modifiers/1.cc
+++ b/libstdc++-v3/testsuite/20_util/any/modifiers/1.cc
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++17" }
-// { dg-do run }
+// { dg-do run { target c++17 } }
// Copyright (C) 2014-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/20_util/any/observers/type.cc b/libstdc++-v3/testsuite/20_util/any/observers/type.cc
index 6d1b3f4b4827..1ef03b66324d 100644
--- a/libstdc++-v3/testsuite/20_util/any/observers/type.cc
+++ b/libstdc++-v3/testsuite/20_util/any/observers/type.cc
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++17" }
-// { dg-do run }
+// { dg-do run { target c++17 } }
// Copyright (C) 2014-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/20_util/any/requirements.cc b/libstdc++-v3/testsuite/20_util/any/requirements.cc
index b5e58911f5ba..192a15c3fa85 100644
--- a/libstdc++-v3/testsuite/20_util/any/requirements.cc
+++ b/libstdc++-v3/testsuite/20_util/any/requirements.cc
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
// Copyright (C) 2016-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/20_util/any/typedefs.cc b/libstdc++-v3/testsuite/20_util/any/typedefs.cc
index f161d70c7f5a..d82a0f54d132 100644
--- a/libstdc++-v3/testsuite/20_util/any/typedefs.cc
+++ b/libstdc++-v3/testsuite/20_util/any/typedefs.cc
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
// Copyright (C) 2014-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/20_util/as_const/1.cc b/libstdc++-v3/testsuite/20_util/as_const/1.cc
index fdeedba3eb5d..6f8b4caa7f2c 100644
--- a/libstdc++-v3/testsuite/20_util/as_const/1.cc
+++ b/libstdc++-v3/testsuite/20_util/as_const/1.cc
@@ -16,7 +16,7 @@
// .
// { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
#include
diff --git a/libstdc++-v3/testsuite/20_util/as_const/rvalue_neg.cc b/libstdc++-v3/testsuite/20_util/as_const/rvalue_neg.cc
index 48ef35d2a905..11880ce80489 100644
--- a/libstdc++-v3/testsuite/20_util/as_const/rvalue_neg.cc
+++ b/libstdc++-v3/testsuite/20_util/as_const/rvalue_neg.cc
@@ -16,7 +16,7 @@
// .
// { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
#include
diff --git a/libstdc++-v3/testsuite/20_util/bind/is_placeholder_v.cc b/libstdc++-v3/testsuite/20_util/bind/is_placeholder_v.cc
index f3be9b93e9a4..7fe8181f3709 100644
--- a/libstdc++-v3/testsuite/20_util/bind/is_placeholder_v.cc
+++ b/libstdc++-v3/testsuite/20_util/bind/is_placeholder_v.cc
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
// Copyright (C) 2016-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/20_util/bool_constant/requirements.cc b/libstdc++-v3/testsuite/20_util/bool_constant/requirements.cc
index cb4256de5e9e..10fc3a60f5a7 100644
--- a/libstdc++-v3/testsuite/20_util/bool_constant/requirements.cc
+++ b/libstdc++-v3/testsuite/20_util/bool_constant/requirements.cc
@@ -16,7 +16,7 @@
// .
// { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
#include
diff --git a/libstdc++-v3/testsuite/20_util/duration/requirements/treat_as_floating_point_v.cc b/libstdc++-v3/testsuite/20_util/duration/requirements/treat_as_floating_point_v.cc
index 82f664909128..518930ffcb94 100644
--- a/libstdc++-v3/testsuite/20_util/duration/requirements/treat_as_floating_point_v.cc
+++ b/libstdc++-v3/testsuite/20_util/duration/requirements/treat_as_floating_point_v.cc
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
// Copyright (C) 2014-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/20_util/duration_cast/rounding.cc b/libstdc++-v3/testsuite/20_util/duration_cast/rounding.cc
index e1b86994570d..845e4a5d5cc6 100644
--- a/libstdc++-v3/testsuite/20_util/duration_cast/rounding.cc
+++ b/libstdc++-v3/testsuite/20_util/duration_cast/rounding.cc
@@ -16,7 +16,7 @@
// .
// { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
#include
diff --git a/libstdc++-v3/testsuite/20_util/enable_shared_from_this/members/weak_from_this.cc b/libstdc++-v3/testsuite/20_util/enable_shared_from_this/members/weak_from_this.cc
index cc68d7ceac57..d83b23ab9a18 100644
--- a/libstdc++-v3/testsuite/20_util/enable_shared_from_this/members/weak_from_this.cc
+++ b/libstdc++-v3/testsuite/20_util/enable_shared_from_this/members/weak_from_this.cc
@@ -16,6 +16,7 @@
// .
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
#include
#include
diff --git a/libstdc++-v3/testsuite/20_util/function_objects/invoke/59768.cc b/libstdc++-v3/testsuite/20_util/function_objects/invoke/59768.cc
index 8df2cf0ff223..692712b06a9a 100644
--- a/libstdc++-v3/testsuite/20_util/function_objects/invoke/59768.cc
+++ b/libstdc++-v3/testsuite/20_util/function_objects/invoke/59768.cc
@@ -16,7 +16,7 @@
// .
// { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
#include
diff --git a/libstdc++-v3/testsuite/20_util/function_objects/not_fn/1.cc b/libstdc++-v3/testsuite/20_util/function_objects/not_fn/1.cc
index ba871597da71..d24f321ef6c9 100644
--- a/libstdc++-v3/testsuite/20_util/function_objects/not_fn/1.cc
+++ b/libstdc++-v3/testsuite/20_util/function_objects/not_fn/1.cc
@@ -16,6 +16,7 @@
// .
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
#include
#include
diff --git a/libstdc++-v3/testsuite/20_util/function_objects/searchers.cc b/libstdc++-v3/testsuite/20_util/function_objects/searchers.cc
index fbf42a16927e..2174f078c340 100644
--- a/libstdc++-v3/testsuite/20_util/function_objects/searchers.cc
+++ b/libstdc++-v3/testsuite/20_util/function_objects/searchers.cc
@@ -16,6 +16,7 @@
// .
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
#include
#include
diff --git a/libstdc++-v3/testsuite/20_util/in_place/requirements.cc b/libstdc++-v3/testsuite/20_util/in_place/requirements.cc
index d6758d2d8928..7bc421402985 100644
--- a/libstdc++-v3/testsuite/20_util/in_place/requirements.cc
+++ b/libstdc++-v3/testsuite/20_util/in_place/requirements.cc
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
// Copyright (C) 2016-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/20_util/is_invocable/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/20_util/is_invocable/requirements/explicit_instantiation.cc
index f860a7e7bd07..a19eda37a01e 100644
--- a/libstdc++-v3/testsuite/20_util/is_invocable/requirements/explicit_instantiation.cc
+++ b/libstdc++-v3/testsuite/20_util/is_invocable/requirements/explicit_instantiation.cc
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
// Copyright (C) 2016-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/20_util/is_invocable/requirements/typedefs.cc b/libstdc++-v3/testsuite/20_util/is_invocable/requirements/typedefs.cc
index ad3fa56c1612..ea3830fe50aa 100644
--- a/libstdc++-v3/testsuite/20_util/is_invocable/requirements/typedefs.cc
+++ b/libstdc++-v3/testsuite/20_util/is_invocable/requirements/typedefs.cc
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
// Copyright (C) 2016-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/20_util/is_invocable/value.cc b/libstdc++-v3/testsuite/20_util/is_invocable/value.cc
index a1d15e47742a..2107c76410ce 100644
--- a/libstdc++-v3/testsuite/20_util/is_invocable/value.cc
+++ b/libstdc++-v3/testsuite/20_util/is_invocable/value.cc
@@ -16,7 +16,7 @@
// .
// { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
#include
diff --git a/libstdc++-v3/testsuite/20_util/is_nothrow_invocable/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/20_util/is_nothrow_invocable/requirements/explicit_instantiation.cc
index 1954110003d0..16fe4e5c61d3 100644
--- a/libstdc++-v3/testsuite/20_util/is_nothrow_invocable/requirements/explicit_instantiation.cc
+++ b/libstdc++-v3/testsuite/20_util/is_nothrow_invocable/requirements/explicit_instantiation.cc
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
// Copyright (C) 2016-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/20_util/is_nothrow_invocable/requirements/typedefs.cc b/libstdc++-v3/testsuite/20_util/is_nothrow_invocable/requirements/typedefs.cc
index 477e836c144e..ee4cdd031a02 100644
--- a/libstdc++-v3/testsuite/20_util/is_nothrow_invocable/requirements/typedefs.cc
+++ b/libstdc++-v3/testsuite/20_util/is_nothrow_invocable/requirements/typedefs.cc
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
// Copyright (C) 2016-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/20_util/is_nothrow_swappable/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/20_util/is_nothrow_swappable/requirements/explicit_instantiation.cc
index ed9a948cbdde..8c86098faf88 100644
--- a/libstdc++-v3/testsuite/20_util/is_nothrow_swappable/requirements/explicit_instantiation.cc
+++ b/libstdc++-v3/testsuite/20_util/is_nothrow_swappable/requirements/explicit_instantiation.cc
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
// Copyright (C) 2015-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/20_util/is_nothrow_swappable/requirements/typedefs.cc b/libstdc++-v3/testsuite/20_util/is_nothrow_swappable/requirements/typedefs.cc
index 62a8de442a25..31ad9727d0b0 100644
--- a/libstdc++-v3/testsuite/20_util/is_nothrow_swappable/requirements/typedefs.cc
+++ b/libstdc++-v3/testsuite/20_util/is_nothrow_swappable/requirements/typedefs.cc
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
// Copyright (C) 2015-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/20_util/is_nothrow_swappable/value.cc b/libstdc++-v3/testsuite/20_util/is_nothrow_swappable/value.cc
index 047d199fab33..b7ef01b7d777 100644
--- a/libstdc++-v3/testsuite/20_util/is_nothrow_swappable/value.cc
+++ b/libstdc++-v3/testsuite/20_util/is_nothrow_swappable/value.cc
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
// Copyright (C) 2015-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/20_util/is_nothrow_swappable_with/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/20_util/is_nothrow_swappable_with/requirements/explicit_instantiation.cc
index d8ce76ef0cd3..83ed01dcb1f5 100644
--- a/libstdc++-v3/testsuite/20_util/is_nothrow_swappable_with/requirements/explicit_instantiation.cc
+++ b/libstdc++-v3/testsuite/20_util/is_nothrow_swappable_with/requirements/explicit_instantiation.cc
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
// Copyright (C) 2016-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/20_util/is_nothrow_swappable_with/requirements/typedefs.cc b/libstdc++-v3/testsuite/20_util/is_nothrow_swappable_with/requirements/typedefs.cc
index 40d166b85712..4fc9bfd9b821 100644
--- a/libstdc++-v3/testsuite/20_util/is_nothrow_swappable_with/requirements/typedefs.cc
+++ b/libstdc++-v3/testsuite/20_util/is_nothrow_swappable_with/requirements/typedefs.cc
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
// Copyright (C) 2016-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/20_util/is_nothrow_swappable_with/value.cc b/libstdc++-v3/testsuite/20_util/is_nothrow_swappable_with/value.cc
index f946a7e82125..87a3d798599e 100644
--- a/libstdc++-v3/testsuite/20_util/is_nothrow_swappable_with/value.cc
+++ b/libstdc++-v3/testsuite/20_util/is_nothrow_swappable_with/value.cc
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
// Copyright (C) 2016-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/20_util/is_swappable/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/20_util/is_swappable/requirements/explicit_instantiation.cc
index f98d712d6475..f8eedd402506 100644
--- a/libstdc++-v3/testsuite/20_util/is_swappable/requirements/explicit_instantiation.cc
+++ b/libstdc++-v3/testsuite/20_util/is_swappable/requirements/explicit_instantiation.cc
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
// Copyright (C) 2015-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/20_util/is_swappable/requirements/typedefs.cc b/libstdc++-v3/testsuite/20_util/is_swappable/requirements/typedefs.cc
index 22a6b9963d5f..55d002f76527 100644
--- a/libstdc++-v3/testsuite/20_util/is_swappable/requirements/typedefs.cc
+++ b/libstdc++-v3/testsuite/20_util/is_swappable/requirements/typedefs.cc
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
// Copyright (C) 2015-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/20_util/is_swappable/value.cc b/libstdc++-v3/testsuite/20_util/is_swappable/value.cc
index 71041bd026a1..d6d423aa83f6 100644
--- a/libstdc++-v3/testsuite/20_util/is_swappable/value.cc
+++ b/libstdc++-v3/testsuite/20_util/is_swappable/value.cc
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
// Copyright (C) 2015-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/20_util/is_swappable_with/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/20_util/is_swappable_with/requirements/explicit_instantiation.cc
index 833ae306d6ec..90edf33ed74a 100644
--- a/libstdc++-v3/testsuite/20_util/is_swappable_with/requirements/explicit_instantiation.cc
+++ b/libstdc++-v3/testsuite/20_util/is_swappable_with/requirements/explicit_instantiation.cc
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
// Copyright (C) 2016-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/20_util/is_swappable_with/requirements/typedefs.cc b/libstdc++-v3/testsuite/20_util/is_swappable_with/requirements/typedefs.cc
index d548b080e18b..f30870fb7a77 100644
--- a/libstdc++-v3/testsuite/20_util/is_swappable_with/requirements/typedefs.cc
+++ b/libstdc++-v3/testsuite/20_util/is_swappable_with/requirements/typedefs.cc
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
// Copyright (C) 2016-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/20_util/is_swappable_with/value.cc b/libstdc++-v3/testsuite/20_util/is_swappable_with/value.cc
index a6b8f2e914cc..5f8b383c5312 100644
--- a/libstdc++-v3/testsuite/20_util/is_swappable_with/value.cc
+++ b/libstdc++-v3/testsuite/20_util/is_swappable_with/value.cc
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
// Copyright (C) 2016-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/20_util/logical_traits/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/20_util/logical_traits/requirements/explicit_instantiation.cc
index 1e2d8a17ef41..53eedc508924 100644
--- a/libstdc++-v3/testsuite/20_util/logical_traits/requirements/explicit_instantiation.cc
+++ b/libstdc++-v3/testsuite/20_util/logical_traits/requirements/explicit_instantiation.cc
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
// Copyright (C) 2015-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/20_util/logical_traits/requirements/typedefs.cc b/libstdc++-v3/testsuite/20_util/logical_traits/requirements/typedefs.cc
index f36b2d1f0d92..f4355a65135f 100644
--- a/libstdc++-v3/testsuite/20_util/logical_traits/requirements/typedefs.cc
+++ b/libstdc++-v3/testsuite/20_util/logical_traits/requirements/typedefs.cc
@@ -22,7 +22,7 @@
#include
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
void test01()
{
diff --git a/libstdc++-v3/testsuite/20_util/logical_traits/value.cc b/libstdc++-v3/testsuite/20_util/logical_traits/value.cc
index 8b99d7f9c94a..34ef32580d35 100644
--- a/libstdc++-v3/testsuite/20_util/logical_traits/value.cc
+++ b/libstdc++-v3/testsuite/20_util/logical_traits/value.cc
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
//
// Copyright (C) 2015-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/20_util/optional/constexpr/make_optional.cc b/libstdc++-v3/testsuite/20_util/optional/constexpr/make_optional.cc
index eadf9eb33db7..6cd1d522b204 100644
--- a/libstdc++-v3/testsuite/20_util/optional/constexpr/make_optional.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/constexpr/make_optional.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/20_util/optional/constexpr/observers/2.cc b/libstdc++-v3/testsuite/20_util/optional/constexpr/observers/2.cc
index 1abde324bbe0..da340dee7bb7 100644
--- a/libstdc++-v3/testsuite/20_util/optional/constexpr/observers/2.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/constexpr/observers/2.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/20_util/optional/constexpr/observers/3.cc b/libstdc++-v3/testsuite/20_util/optional/constexpr/observers/3.cc
index abd2e7dcbba8..751ae499cdbd 100644
--- a/libstdc++-v3/testsuite/20_util/optional/constexpr/observers/3.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/constexpr/observers/3.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/20_util/optional/hash.cc b/libstdc++-v3/testsuite/20_util/optional/hash.cc
index d0c076563020..d37453a7bee1 100644
--- a/libstdc++-v3/testsuite/20_util/optional/hash.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/hash.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2016-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/20_util/pair/swap_cxx17.cc b/libstdc++-v3/testsuite/20_util/pair/swap_cxx17.cc
index 45c4b42ed713..bce3e33e8d9e 100644
--- a/libstdc++-v3/testsuite/20_util/pair/swap_cxx17.cc
+++ b/libstdc++-v3/testsuite/20_util/pair/swap_cxx17.cc
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
// Copyright (C) 2016-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/20_util/ratio/requirements/ratio_equal_v.cc b/libstdc++-v3/testsuite/20_util/ratio/requirements/ratio_equal_v.cc
index 2caff91e1a2f..b8f68cdbeeca 100644
--- a/libstdc++-v3/testsuite/20_util/ratio/requirements/ratio_equal_v.cc
+++ b/libstdc++-v3/testsuite/20_util/ratio/requirements/ratio_equal_v.cc
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
// Copyright (C) 2014-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/20_util/shared_ptr/requirements/weak_type.cc b/libstdc++-v3/testsuite/20_util/shared_ptr/requirements/weak_type.cc
index 653176efeb09..beb49dda4a2f 100644
--- a/libstdc++-v3/testsuite/20_util/shared_ptr/requirements/weak_type.cc
+++ b/libstdc++-v3/testsuite/20_util/shared_ptr/requirements/weak_type.cc
@@ -16,7 +16,7 @@
// .
// { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
#include
diff --git a/libstdc++-v3/testsuite/20_util/specialized_algorithms/memory_management_tools/1.cc b/libstdc++-v3/testsuite/20_util/specialized_algorithms/memory_management_tools/1.cc
index 682a164768ee..b7cf05facc4e 100644
--- a/libstdc++-v3/testsuite/20_util/specialized_algorithms/memory_management_tools/1.cc
+++ b/libstdc++-v3/testsuite/20_util/specialized_algorithms/memory_management_tools/1.cc
@@ -16,6 +16,7 @@
// .
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
#include
#include
diff --git a/libstdc++-v3/testsuite/20_util/tuple/apply/1.cc b/libstdc++-v3/testsuite/20_util/tuple/apply/1.cc
index 650501161079..2baf651ef721 100644
--- a/libstdc++-v3/testsuite/20_util/tuple/apply/1.cc
+++ b/libstdc++-v3/testsuite/20_util/tuple/apply/1.cc
@@ -16,6 +16,7 @@
// .
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
#include
#include
diff --git a/libstdc++-v3/testsuite/20_util/tuple/make_from_tuple/1.cc b/libstdc++-v3/testsuite/20_util/tuple/make_from_tuple/1.cc
index 4f0e76cdae39..282bc512c9af 100644
--- a/libstdc++-v3/testsuite/20_util/tuple/make_from_tuple/1.cc
+++ b/libstdc++-v3/testsuite/20_util/tuple/make_from_tuple/1.cc
@@ -16,6 +16,7 @@
// .
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
#include
#include
diff --git a/libstdc++-v3/testsuite/20_util/tuple/swap_cxx17.cc b/libstdc++-v3/testsuite/20_util/tuple/swap_cxx17.cc
index 6c163e4c7e23..ff18f8181b43 100644
--- a/libstdc++-v3/testsuite/20_util/tuple/swap_cxx17.cc
+++ b/libstdc++-v3/testsuite/20_util/tuple/swap_cxx17.cc
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
// Copyright (C) 2016-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/20_util/tuple/tuple_size_v.cc b/libstdc++-v3/testsuite/20_util/tuple/tuple_size_v.cc
index a1d20e2021d5..0e91f0653cfc 100644
--- a/libstdc++-v3/testsuite/20_util/tuple/tuple_size_v.cc
+++ b/libstdc++-v3/testsuite/20_util/tuple/tuple_size_v.cc
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
// Copyright (C) 2014-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/20_util/unique_ptr/specialized_algorithms/swap_cxx17.cc b/libstdc++-v3/testsuite/20_util/unique_ptr/specialized_algorithms/swap_cxx17.cc
index 96035bdd3225..6a5c8082afb5 100644
--- a/libstdc++-v3/testsuite/20_util/unique_ptr/specialized_algorithms/swap_cxx17.cc
+++ b/libstdc++-v3/testsuite/20_util/unique_ptr/specialized_algorithms/swap_cxx17.cc
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
// Copyright (C) 2016-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/20_util/uses_allocator/requirements/uses_allocator_v.cc b/libstdc++-v3/testsuite/20_util/uses_allocator/requirements/uses_allocator_v.cc
index f89caa16d0a6..d09743627622 100644
--- a/libstdc++-v3/testsuite/20_util/uses_allocator/requirements/uses_allocator_v.cc
+++ b/libstdc++-v3/testsuite/20_util/uses_allocator/requirements/uses_allocator_v.cc
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
// Copyright (C) 2016-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/20_util/variant/any.cc b/libstdc++-v3/testsuite/20_util/variant/any.cc
index bba4ee57b8ab..fffa3f360123 100644
--- a/libstdc++-v3/testsuite/20_util/variant/any.cc
+++ b/libstdc++-v3/testsuite/20_util/variant/any.cc
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
// Copyright (C) 2017-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/20_util/variant/compile.cc b/libstdc++-v3/testsuite/20_util/variant/compile.cc
index 5f681754b5f2..5e9e80c38401 100644
--- a/libstdc++-v3/testsuite/20_util/variant/compile.cc
+++ b/libstdc++-v3/testsuite/20_util/variant/compile.cc
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
// Copyright (C) 2016-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/20_util/variant/hash.cc b/libstdc++-v3/testsuite/20_util/variant/hash.cc
index 90151d9f0c92..a43f39eb3032 100644
--- a/libstdc++-v3/testsuite/20_util/variant/hash.cc
+++ b/libstdc++-v3/testsuite/20_util/variant/hash.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2016-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/20_util/variant/index_type.cc b/libstdc++-v3/testsuite/20_util/variant/index_type.cc
index a1136d6be9dd..73863fa677f8 100644
--- a/libstdc++-v3/testsuite/20_util/variant/index_type.cc
+++ b/libstdc++-v3/testsuite/20_util/variant/index_type.cc
@@ -1,5 +1,6 @@
// { dg-options "-std=gnu++17" }
// { dg-do compile { target { ilp32 || lp64 } } }
+// { dg-require-effective-target c++17 }
// Copyright (C) 2017-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/20_util/variant/run.cc b/libstdc++-v3/testsuite/20_util/variant/run.cc
index 0ac5de25289e..578ade48f568 100644
--- a/libstdc++-v3/testsuite/20_util/variant/run.cc
+++ b/libstdc++-v3/testsuite/20_util/variant/run.cc
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++17" }
-// { dg-do run }
+// { dg-do run { target c++17 } }
// Copyright (C) 2016-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/20_util/void_t/1.cc b/libstdc++-v3/testsuite/20_util/void_t/1.cc
index a6ded5875b6f..d59d07f4de72 100644
--- a/libstdc++-v3/testsuite/20_util/void_t/1.cc
+++ b/libstdc++-v3/testsuite/20_util/void_t/1.cc
@@ -16,7 +16,7 @@
// .
// { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
#include
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/79162.cc b/libstdc++-v3/testsuite/21_strings/basic_string/79162.cc
index a1a69780793c..cedf6b76a0f5 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/79162.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/79162.cc
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
// Copyright (C) 2017-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/7.cc b/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/7.cc
index 7e0e9983898e..61cfbe6caf75 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/7.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/7.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2016-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/cons/wchar_t/7.cc b/libstdc++-v3/testsuite/21_strings/basic_string/cons/wchar_t/7.cc
index 44920d5e0bb9..c5491a3bd029 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/cons/wchar_t/7.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/cons/wchar_t/7.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2016-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/lwg2758.cc b/libstdc++-v3/testsuite/21_strings/basic_string/lwg2758.cc
index 16abb9c4bd72..3284caeaad68 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/lwg2758.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/lwg2758.cc
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
// Copyright (C) 2016-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/lwg2946.cc b/libstdc++-v3/testsuite/21_strings/basic_string/lwg2946.cc
index e95cd7777d60..ccb577aa9025 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/lwg2946.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/lwg2946.cc
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
// Copyright (C) 2017-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/append/char/4.cc b/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/append/char/4.cc
index cc8f896f1a37..2eac4e9e075b 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/append/char/4.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/append/char/4.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2016-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/append/wchar_t/4.cc b/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/append/wchar_t/4.cc
index c3e13d1f9faa..c09b55b4bd54 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/append/wchar_t/4.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/append/wchar_t/4.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2016-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/assign/char/4.cc b/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/assign/char/4.cc
index 29d4e4c6c0b6..5497f155b141 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/assign/char/4.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/assign/char/4.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2016-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/assign/wchar_t/4.cc b/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/assign/wchar_t/4.cc
index 136388d69f48..59e874fd89e7 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/assign/wchar_t/4.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/assign/wchar_t/4.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2016-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/insert/char/3.cc b/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/insert/char/3.cc
index 7fd5850fe580..aaefc7f0ef7d 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/insert/char/3.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/insert/char/3.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2016-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/insert/wchar_t/3.cc b/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/insert/wchar_t/3.cc
index d585f85306ec..48b828710bf1 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/insert/wchar_t/3.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/insert/wchar_t/3.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2016-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/replace/char/7.cc b/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/replace/char/7.cc
index 8918edd54a41..fe97517fb19c 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/replace/char/7.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/replace/char/7.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2016-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/replace/wchar_t/7.cc b/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/replace/wchar_t/7.cc
index 9622ebefcfff..0e2437b84ac7 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/replace/wchar_t/7.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/modifiers/replace/wchar_t/7.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2016-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/operations/compare/char/2.cc b/libstdc++-v3/testsuite/21_strings/basic_string/operations/compare/char/2.cc
index d9c9aaed9fa4..f2713122a440 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/operations/compare/char/2.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/operations/compare/char/2.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2016-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/operations/compare/wchar_t/2.cc b/libstdc++-v3/testsuite/21_strings/basic_string/operations/compare/wchar_t/2.cc
index b8856e530beb..a83c9a1db073 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/operations/compare/wchar_t/2.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/operations/compare/wchar_t/2.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2016-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/operations/data/char/2.cc b/libstdc++-v3/testsuite/21_strings/basic_string/operations/data/char/2.cc
index 7608a0dcb4f6..edd7029a7079 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/operations/data/char/2.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/operations/data/char/2.cc
@@ -16,6 +16,7 @@
// .
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// C++17 21.3.1.7 [string.ops] string operations
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/operations/data/wchar_t/2.cc b/libstdc++-v3/testsuite/21_strings/basic_string/operations/data/wchar_t/2.cc
index 3c977e05464e..7099695e739e 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/operations/data/wchar_t/2.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/operations/data/wchar_t/2.cc
@@ -16,6 +16,7 @@
// .
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// C++17 21.3.1.7 [string.ops] string operations
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/operations/find/char/5.cc b/libstdc++-v3/testsuite/21_strings/basic_string/operations/find/char/5.cc
index 366091172944..746551b0c487 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/operations/find/char/5.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/operations/find/char/5.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2016-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/operations/find/wchar_t/5.cc b/libstdc++-v3/testsuite/21_strings/basic_string/operations/find/wchar_t/5.cc
index 56f98ea990a7..334904d5c041 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/operations/find/wchar_t/5.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/operations/find/wchar_t/5.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2016-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/operators/char/5.cc b/libstdc++-v3/testsuite/21_strings/basic_string/operators/char/5.cc
index 0aabab479df1..c6f9b048d05c 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/operators/char/5.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/operators/char/5.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2016-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/operators/wchar_t/5.cc b/libstdc++-v3/testsuite/21_strings/basic_string/operators/wchar_t/5.cc
index b9437a3504eb..1510766578c4 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/operators/wchar_t/5.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/operators/wchar_t/5.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2016-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/capacity/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/capacity/1.cc
index 5bbf33381658..0307a5bd85d9 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/capacity/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/capacity/1.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/cons/char/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/cons/char/1.cc
index e86254b8e855..128ce812ebca 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/cons/char/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/cons/char/1.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/cons/char/2.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/cons/char/2.cc
index 8098654315ce..7bda603d36c2 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/cons/char/2.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/cons/char/2.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/cons/char/3.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/cons/char/3.cc
index dae84097e4e9..a1bb285a0352 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/cons/char/3.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/cons/char/3.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/cons/wchar_t/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/cons/wchar_t/1.cc
index ccf7cd361ede..81f622f12954 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/cons/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/cons/wchar_t/1.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/cons/wchar_t/2.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/cons/wchar_t/2.cc
index 62928fcebc66..ea912c27d4fa 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/cons/wchar_t/2.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/cons/wchar_t/2.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/cons/wchar_t/3.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/cons/wchar_t/3.cc
index f00b0361e163..a806773c846a 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/cons/wchar_t/3.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/cons/wchar_t/3.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/element_access/char/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/element_access/char/1.cc
index b1bc4aa39a56..52e8d3faacb7 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/element_access/char/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/element_access/char/1.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/element_access/char/2.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/element_access/char/2.cc
index 29402d066e25..5978c366824d 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/element_access/char/2.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/element_access/char/2.cc
@@ -1,6 +1,7 @@
-// { dg-do run { xfail *-*-* } }
// { dg-options "-std=gnu++17 -O0" }
+// { dg-do run { target c++17 } }
// { dg-require-debug-mode "" }
+// { dg-xfail-run-if "expect debug mode assertion to fail" { *-*-* } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/element_access/char/empty.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/element_access/char/empty.cc
index f22bc53886c2..44de1a46340d 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/element_access/char/empty.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/element_access/char/empty.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/element_access/char/front_back.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/element_access/char/front_back.cc
index 60174f0f33c9..12992b2c34f0 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/element_access/char/front_back.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/element_access/char/front_back.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// { dg-require-string-conversions "" }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/element_access/wchar_t/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/element_access/wchar_t/1.cc
index bae9f5b4b06b..9749941bd71d 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/element_access/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/element_access/wchar_t/1.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/element_access/wchar_t/2.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/element_access/wchar_t/2.cc
index 1f811538bb4a..90be1b373747 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/element_access/wchar_t/2.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/element_access/wchar_t/2.cc
@@ -1,6 +1,7 @@
-// { dg-do run { xfail *-*-* } }
// { dg-options "-std=gnu++17 -O0" }
+// { dg-do run { target c++17 } }
// { dg-require-debug-mode "" }
+// { dg-xfail-run-if "expect debug mode assertion to fail" { *-*-* } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/element_access/wchar_t/empty.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/element_access/wchar_t/empty.cc
index 52c8dd52016f..35f411230f1c 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/element_access/wchar_t/empty.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/element_access/wchar_t/empty.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/element_access/wchar_t/front_back.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/element_access/wchar_t/front_back.cc
index 812e9f96257c..edf50fb2c249 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/element_access/wchar_t/front_back.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/element_access/wchar_t/front_back.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// { dg-require-string-conversions "" }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/include.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/include.cc
index bca70bfe0a8b..688a5a00c8b4 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/include.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/include.cc
@@ -20,6 +20,6 @@
// NB: This issue affected only debug-mode.
// { dg-options "-std=gnu++17 -fno-rtti" }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
#include
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/inserters/char/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/inserters/char/1.cc
index fa2f1f91a463..c565cca8bb41 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/inserters/char/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/inserters/char/1.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/inserters/char/2.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/inserters/char/2.cc
index 8fa3e5ce6e59..7bf91c1ad831 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/inserters/char/2.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/inserters/char/2.cc
@@ -23,6 +23,7 @@
// all of the string_view class.
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// { dg-require-fileio "" }
#include
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/inserters/char/3.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/inserters/char/3.cc
index 0d689c3eff4d..69bb7732d074 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/inserters/char/3.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/inserters/char/3.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/inserters/pod/10081-out.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/inserters/pod/10081-out.cc
index 0ed6e8e48834..89e94f329ffa 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/inserters/pod/10081-out.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/inserters/pod/10081-out.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/inserters/wchar_t/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/inserters/wchar_t/1.cc
index 9d632573c79e..16eb9fe898a2 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/inserters/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/inserters/wchar_t/1.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/inserters/wchar_t/2.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/inserters/wchar_t/2.cc
index 0d587e4bf047..ce75c89c824e 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/inserters/wchar_t/2.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/inserters/wchar_t/2.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// { dg-require-fileio "" }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/inserters/wchar_t/3.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/inserters/wchar_t/3.cc
index b1fe5bc38917..47861cbdd798 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/inserters/wchar_t/3.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/inserters/wchar_t/3.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/literals/types-char8_t.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/literals/types-char8_t.cc
index c84acfa6acde..8a155886f1a3 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/literals/types-char8_t.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/literals/types-char8_t.cc
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++17 -fchar8_t" }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/literals/types.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/literals/types.cc
index f0c1c2cd5d81..5d8fc1465e4e 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/literals/types.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/literals/types.cc
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/literals/values-char8_t.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/literals/values-char8_t.cc
index 9acf11117dd6..4e2aa1110801 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/literals/values-char8_t.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/literals/values-char8_t.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17 -fchar8_t" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/literals/values.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/literals/values.cc
index f01b2126697f..f00778a82c95 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/literals/values.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/literals/values.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/modifiers/remove_prefix/char/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/modifiers/remove_prefix/char/1.cc
index 9c207ef0948f..1f00688a915c 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/modifiers/remove_prefix/char/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/modifiers/remove_prefix/char/1.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/modifiers/remove_prefix/wchar_t/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/modifiers/remove_prefix/wchar_t/1.cc
index aa7674fef374..fee592809597 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/modifiers/remove_prefix/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/modifiers/remove_prefix/wchar_t/1.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/modifiers/remove_suffix/char/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/modifiers/remove_suffix/char/1.cc
index 47bacd2dbf1b..e222188b45ae 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/modifiers/remove_suffix/char/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/modifiers/remove_suffix/char/1.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/modifiers/remove_suffix/wchar_t/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/modifiers/remove_suffix/wchar_t/1.cc
index 1548a81beb3f..148c8d3150a4 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/modifiers/remove_suffix/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/modifiers/remove_suffix/wchar_t/1.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/compare/char/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/compare/char/1.cc
index b4ef8c034f44..9bd3889584d2 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/compare/char/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/compare/char/1.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/compare/char/13650.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/compare/char/13650.cc
index f1de99145a9c..0c15eb2b7e64 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/compare/char/13650.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/compare/char/13650.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/compare/wchar_t/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/compare/wchar_t/1.cc
index f609e9636ff1..91eea8412f9a 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/compare/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/compare/wchar_t/1.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/compare/wchar_t/13650.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/compare/wchar_t/13650.cc
index 58a3e9a6dccb..e4eef0fbb639 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/compare/wchar_t/13650.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/compare/wchar_t/13650.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/copy/char/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/copy/char/1.cc
index c672b7fa609a..7dc6ed59768d 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/copy/char/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/copy/char/1.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/copy/wchar_t/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/copy/wchar_t/1.cc
index fbe6c4661638..ce909d2342f9 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/copy/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/copy/wchar_t/1.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/data/char/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/data/char/1.cc
index 18fc9f5fe888..8a0dfd990bb9 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/data/char/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/data/char/1.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2013-2014 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/data/wchar_t/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/data/wchar_t/1.cc
index 6596db528996..f4c9a51cd50f 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/data/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/data/wchar_t/1.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2013-2014 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/char/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/char/1.cc
index 73f752eabd62..c3cb4466d2d6 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/char/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/char/1.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/char/2.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/char/2.cc
index 8565b5ff450b..4313ac6f7612 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/char/2.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/char/2.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/char/3.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/char/3.cc
index 5f171e9dc209..3dad36232608 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/char/3.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/char/3.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/char/4.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/char/4.cc
index f4391e675d74..c95ded1254d2 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/char/4.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/char/4.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/wchar_t/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/wchar_t/1.cc
index 6a2f3759beb7..591d680f13b3 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/wchar_t/1.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/wchar_t/2.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/wchar_t/2.cc
index ee0ed0941e01..947713dc3069 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/wchar_t/2.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/wchar_t/2.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/wchar_t/3.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/wchar_t/3.cc
index 6b8d2b82d232..a9a07c3cc611 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/wchar_t/3.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/wchar_t/3.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/wchar_t/4.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/wchar_t/4.cc
index ac504ce4c09b..0da4f05c4343 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/wchar_t/4.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/wchar_t/4.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/rfind/char/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/rfind/char/1.cc
index 1e0b948912b5..39e8b977a7bd 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/rfind/char/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/rfind/char/1.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/rfind/char/2.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/rfind/char/2.cc
index fdca3fc0209b..4e6affb803b2 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/rfind/char/2.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/rfind/char/2.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/rfind/char/3.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/rfind/char/3.cc
index 809f015c3d5d..f462a7b7e4d7 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/rfind/char/3.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/rfind/char/3.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/rfind/wchar_t/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/rfind/wchar_t/1.cc
index ab3f80f4cd9b..2246332e3d54 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/rfind/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/rfind/wchar_t/1.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/rfind/wchar_t/2.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/rfind/wchar_t/2.cc
index 8fb37930180f..12fff465c104 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/rfind/wchar_t/2.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/rfind/wchar_t/2.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/rfind/wchar_t/3.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/rfind/wchar_t/3.cc
index 4e32edfe1c8a..4f9e225bcc7b 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/rfind/wchar_t/3.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/rfind/wchar_t/3.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/string_conversion/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/string_conversion/1.cc
index 806f5d4de678..8d853232ae9d 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/string_conversion/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/string_conversion/1.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2014-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/substr/char/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/substr/char/1.cc
index 1c22d62063b7..f67c119f0d8a 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/substr/char/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/substr/char/1.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/substr/wchar_t/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/substr/wchar_t/1.cc
index 8a31bd5e0351..a13b26dfb39b 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/substr/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/substr/wchar_t/1.cc
@@ -1,4 +1,5 @@
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/range_access/char/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/range_access/char/1.cc
index 3313cc6005e2..e14faa22c615 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/range_access/char/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/range_access/char/1.cc
@@ -1,5 +1,5 @@
-// { dg-do compile }
// { dg-options "-std=gnu++17" }
+// { dg-do compile { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/range_access/wchar_t/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/range_access/wchar_t/1.cc
index b899bd582bba..db53491a0791 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/range_access/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/range_access/wchar_t/1.cc
@@ -1,5 +1,5 @@
-// { dg-do compile }
// { dg-options "-std=gnu++17" }
+// { dg-do compile { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/requirements/explicit_instantiation/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/requirements/explicit_instantiation/1.cc
index 0cf21ad443b2..b09d4ec663dd 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/requirements/explicit_instantiation/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/requirements/explicit_instantiation/1.cc
@@ -20,7 +20,7 @@
#include
-// { dg-do compile }
// { dg-options "-std=gnu++17" }
+// { dg-do compile { target c++17 } }
template class std::basic_string_view>;
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/requirements/explicit_instantiation/char/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/requirements/explicit_instantiation/char/1.cc
index 0cf62561a073..a3eb2f343425 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/requirements/explicit_instantiation/char/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/requirements/explicit_instantiation/char/1.cc
@@ -1,5 +1,5 @@
-// { dg-do compile }
// { dg-options "-std=gnu++17" }
+// { dg-do compile { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/requirements/explicit_instantiation/char16_t/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/requirements/explicit_instantiation/char16_t/1.cc
index 47fdd41aa9c9..3d32915505b3 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/requirements/explicit_instantiation/char16_t/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/requirements/explicit_instantiation/char16_t/1.cc
@@ -1,5 +1,5 @@
-// { dg-do compile }
// { dg-options "-std=gnu++17" }
+// { dg-do compile { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/requirements/explicit_instantiation/char32_t/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/requirements/explicit_instantiation/char32_t/1.cc
index 7abd74b35001..5bb50e614ed8 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/requirements/explicit_instantiation/char32_t/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/requirements/explicit_instantiation/char32_t/1.cc
@@ -1,5 +1,5 @@
-// { dg-do compile }
// { dg-options "-std=gnu++17" }
+// { dg-do compile { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/requirements/explicit_instantiation/char8_t/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/requirements/explicit_instantiation/char8_t/1.cc
index 4f31f19031d1..a951f75e1b06 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/requirements/explicit_instantiation/char8_t/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/requirements/explicit_instantiation/char8_t/1.cc
@@ -1,5 +1,5 @@
-// { dg-do compile }
// { dg-options "-std=gnu++17 -fchar8_t" }
+// { dg-do compile { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/requirements/explicit_instantiation/wchar_t/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/requirements/explicit_instantiation/wchar_t/1.cc
index 41a2add47c92..bfbb64e2a86c 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/requirements/explicit_instantiation/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/requirements/explicit_instantiation/wchar_t/1.cc
@@ -1,5 +1,5 @@
-// { dg-do compile }
// { dg-options "-std=gnu++17" }
+// { dg-do compile { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/requirements/typedefs.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/requirements/typedefs.cc
index 71299a919d95..f3236d1d0aa2 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/requirements/typedefs.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/requirements/typedefs.cc
@@ -1,6 +1,6 @@
// { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
// Copyright (C) 2013-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/typedefs.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/typedefs.cc
index a0bbca1c89bc..c1ece8381e7d 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/typedefs.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/typedefs.cc
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
// Copyright (C) 2014-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/types/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/types/1.cc
index b95036d133c8..818c3bbe044b 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string_view/types/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/types/1.cc
@@ -18,7 +18,7 @@
//
// { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
#include
diff --git a/libstdc++-v3/testsuite/23_containers/array/specialized_algorithms/swap_cxx17.cc b/libstdc++-v3/testsuite/23_containers/array/specialized_algorithms/swap_cxx17.cc
index 6831e3e34787..8ec631b287f3 100644
--- a/libstdc++-v3/testsuite/23_containers/array/specialized_algorithms/swap_cxx17.cc
+++ b/libstdc++-v3/testsuite/23_containers/array/specialized_algorithms/swap_cxx17.cc
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
// Copyright (C) 2016-2020 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/23_containers/map/modifiers/extract.cc b/libstdc++-v3/testsuite/23_containers/map/modifiers/extract.cc
index 507ba6177f8e..9f85811e2faf 100644
--- a/libstdc++-v3/testsuite/23_containers/map/modifiers/extract.cc
+++ b/libstdc++-v3/testsuite/23_containers/map/modifiers/extract.cc
@@ -16,6 +16,7 @@
// .
// { dg-options "-std=gnu++17" }
+// { dg-do run { target c++17 } }
#include