diff --git a/libstdc++-v3/testsuite/20_util/optional/77288.cc b/libstdc++-v3/testsuite/20_util/optional/77288.cc
index 6f3f7f4..cd3dc0e 100644
--- a/libstdc++-v3/testsuite/20_util/optional/77288.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/77288.cc
@@ -1,5 +1,5 @@
 // { dg-options "-std=gnu++17" }
-// { dg-do run }
+// { dg-do run { target c++17 }  }
 
 // Copyright (C) 2016-2018 Free Software Foundation, Inc.
 //
diff --git a/libstdc++-v3/testsuite/20_util/optional/84601.cc b/libstdc++-v3/testsuite/20_util/optional/84601.cc
index e86d39e..b8a1706 100644
--- a/libstdc++-v3/testsuite/20_util/optional/84601.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/84601.cc
@@ -1,5 +1,5 @@
 // { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 }  }
 
 #include <optional>
 
diff --git a/libstdc++-v3/testsuite/20_util/optional/assignment/1.cc b/libstdc++-v3/testsuite/20_util/optional/assignment/1.cc
index f9aaae3..ec0832b 100644
--- a/libstdc++-v3/testsuite/20_util/optional/assignment/1.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/assignment/1.cc
@@ -1,5 +1,5 @@
 // { dg-options "-std=gnu++17" }
-// { dg-do run }
+// { dg-do run { target c++17 }  }
 
 // Copyright (C) 2013-2018 Free Software Foundation, Inc.
 //
diff --git a/libstdc++-v3/testsuite/20_util/optional/assignment/2.cc b/libstdc++-v3/testsuite/20_util/optional/assignment/2.cc
index c3832e9..772f7bf 100644
--- a/libstdc++-v3/testsuite/20_util/optional/assignment/2.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/assignment/2.cc
@@ -1,5 +1,5 @@
 // { dg-options "-std=gnu++17" }
-// { dg-do run }
+// { dg-do run { target c++17 }  }
 
 // Copyright (C) 2013-2018 Free Software Foundation, Inc.
 //
diff --git a/libstdc++-v3/testsuite/20_util/optional/assignment/3.cc b/libstdc++-v3/testsuite/20_util/optional/assignment/3.cc
index 885a9f9..34fa7a2 100644
--- a/libstdc++-v3/testsuite/20_util/optional/assignment/3.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/assignment/3.cc
@@ -1,5 +1,5 @@
 // { dg-options "-std=gnu++17" }
-// { dg-do run }
+// { dg-do run { target c++17 }  }
 
 // Copyright (C) 2013-2018 Free Software Foundation, Inc.
 //
diff --git a/libstdc++-v3/testsuite/20_util/optional/assignment/4.cc b/libstdc++-v3/testsuite/20_util/optional/assignment/4.cc
index f498156..bf455e4 100644
--- a/libstdc++-v3/testsuite/20_util/optional/assignment/4.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/assignment/4.cc
@@ -1,5 +1,5 @@
 // { dg-options "-std=gnu++17" }
-// { dg-do run }
+// { dg-do run { target c++17 }  }
 
 // Copyright (C) 2013-2018 Free Software Foundation, Inc.
 //
diff --git a/libstdc++-v3/testsuite/20_util/optional/assignment/5.cc b/libstdc++-v3/testsuite/20_util/optional/assignment/5.cc
index faea0eb..b200ee0 100644
--- a/libstdc++-v3/testsuite/20_util/optional/assignment/5.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/assignment/5.cc
@@ -1,5 +1,5 @@
 // { dg-options "-std=gnu++17" }
-// { dg-do run }
+// { dg-do run { target c++17 }  }
 
 // Copyright (C) 2013-2018 Free Software Foundation, Inc.
 //
diff --git a/libstdc++-v3/testsuite/20_util/optional/assignment/6.cc b/libstdc++-v3/testsuite/20_util/optional/assignment/6.cc
index 5de6e59..48813f6 100644
--- a/libstdc++-v3/testsuite/20_util/optional/assignment/6.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/assignment/6.cc
@@ -1,5 +1,5 @@
 // { dg-options "-std=gnu++17" }
-// { dg-do run }
+// { dg-do run { target c++17 }  }
 
 // Copyright (C) 2013-2018 Free Software Foundation, Inc.
 //
diff --git a/libstdc++-v3/testsuite/20_util/optional/assignment/7.cc b/libstdc++-v3/testsuite/20_util/optional/assignment/7.cc
index 0ed357b..1c4bd48 100644
--- a/libstdc++-v3/testsuite/20_util/optional/assignment/7.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/assignment/7.cc
@@ -1,5 +1,5 @@
 // { dg-options "-std=gnu++17" }
-// { dg-do run }
+// { dg-do run { target c++17 }  }
 
 // Copyright (C) 2016-2018 Free Software Foundation, Inc.
 //
diff --git a/libstdc++-v3/testsuite/20_util/optional/assignment/8.cc b/libstdc++-v3/testsuite/20_util/optional/assignment/8.cc
index 7241b92..6fa1164 100644
--- a/libstdc++-v3/testsuite/20_util/optional/assignment/8.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/assignment/8.cc
@@ -1,5 +1,5 @@
 // { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 }  }
 
 // Copyright (C) 2018 Free Software Foundation, Inc.
 //
diff --git a/libstdc++-v3/testsuite/20_util/optional/cons/77727.cc b/libstdc++-v3/testsuite/20_util/optional/cons/77727.cc
index aca2e2d..8d39ae7 100644
--- a/libstdc++-v3/testsuite/20_util/optional/cons/77727.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/cons/77727.cc
@@ -1,5 +1,5 @@
 // { dg-options "-std=gnu++17" }
-// { dg-do run }
+// { dg-do run { target c++17 }  }
 
 // Copyright (C) 2016-2018 Free Software Foundation, Inc.
 //
diff --git a/libstdc++-v3/testsuite/20_util/optional/cons/copy.cc b/libstdc++-v3/testsuite/20_util/optional/cons/copy.cc
index 25cc53f..ba7e48a 100644
--- a/libstdc++-v3/testsuite/20_util/optional/cons/copy.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/cons/copy.cc
@@ -1,5 +1,5 @@
 // { dg-options "-std=gnu++17" }
-// { dg-do run }
+// { dg-do run { target c++17 }  }
 
 // Copyright (C) 2013-2018 Free Software Foundation, Inc.
 //
diff --git a/libstdc++-v3/testsuite/20_util/optional/cons/deduction.cc b/libstdc++-v3/testsuite/20_util/optional/cons/deduction.cc
index 8b8b707..cc56701 100644
--- a/libstdc++-v3/testsuite/20_util/optional/cons/deduction.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/cons/deduction.cc
@@ -16,7 +16,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 }  }
 
 #include <optional>
 #include <type_traits>
diff --git a/libstdc++-v3/testsuite/20_util/optional/cons/default.cc b/libstdc++-v3/testsuite/20_util/optional/cons/default.cc
index 2e28daf..7a73832 100644
--- a/libstdc++-v3/testsuite/20_util/optional/cons/default.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/cons/default.cc
@@ -1,5 +1,5 @@
 // { dg-options "-std=gnu++17" }
-// { dg-do run }
+// { dg-do run { target c++17 }  }
 
 // Copyright (C) 2013-2018 Free Software Foundation, Inc.
 //
diff --git a/libstdc++-v3/testsuite/20_util/optional/cons/move.cc b/libstdc++-v3/testsuite/20_util/optional/cons/move.cc
index 250b715..f68a948 100644
--- a/libstdc++-v3/testsuite/20_util/optional/cons/move.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/cons/move.cc
@@ -1,5 +1,5 @@
 // { dg-options "-std=gnu++17" }
-// { dg-do run }
+// { dg-do run { target c++17 }  }
 
 // Copyright (C) 2013-2018 Free Software Foundation, Inc.
 //
diff --git a/libstdc++-v3/testsuite/20_util/optional/cons/trivial.cc b/libstdc++-v3/testsuite/20_util/optional/cons/trivial.cc
index 84a8e10..7528be8 100644
--- a/libstdc++-v3/testsuite/20_util/optional/cons/trivial.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/cons/trivial.cc
@@ -1,5 +1,5 @@
 // { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 }  }
 
 // Copyright (C) 2018 Free Software Foundation, Inc.
 //
diff --git a/libstdc++-v3/testsuite/20_util/optional/cons/value.cc b/libstdc++-v3/testsuite/20_util/optional/cons/value.cc
index 34dbb93..bdc9e7e 100644
--- a/libstdc++-v3/testsuite/20_util/optional/cons/value.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/cons/value.cc
@@ -1,5 +1,5 @@
 // { dg-options "-std=gnu++17" }
-// { dg-do run }
+// { dg-do run { target c++17 }  }
 
 // Copyright (C) 2013-2018 Free Software Foundation, Inc.
 //
diff --git a/libstdc++-v3/testsuite/20_util/optional/cons/value_neg.cc b/libstdc++-v3/testsuite/20_util/optional/cons/value_neg.cc
index 020cb26..133a8b0 100644
--- a/libstdc++-v3/testsuite/20_util/optional/cons/value_neg.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/cons/value_neg.cc
@@ -1,5 +1,5 @@
 // { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 }  }
 
 // Copyright (C) 2013-2018 Free Software Foundation, Inc.
 //
diff --git a/libstdc++-v3/testsuite/20_util/optional/constexpr/cons/default.cc b/libstdc++-v3/testsuite/20_util/optional/constexpr/cons/default.cc
index f991efc..eeef0fd 100644
--- a/libstdc++-v3/testsuite/20_util/optional/constexpr/cons/default.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/constexpr/cons/default.cc
@@ -1,5 +1,5 @@
 // { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 }  }
 
 // Copyright (C) 2013-2018 Free Software Foundation, Inc.
 //
diff --git a/libstdc++-v3/testsuite/20_util/optional/constexpr/cons/value.cc b/libstdc++-v3/testsuite/20_util/optional/constexpr/cons/value.cc
index f5da900..baba7ff 100644
--- a/libstdc++-v3/testsuite/20_util/optional/constexpr/cons/value.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/constexpr/cons/value.cc
@@ -1,5 +1,5 @@
 // { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 }  }
 
 // Copyright (C) 2013-2018 Free Software Foundation, Inc.
 //
diff --git a/libstdc++-v3/testsuite/20_util/optional/constexpr/in_place.cc b/libstdc++-v3/testsuite/20_util/optional/constexpr/in_place.cc
index 0759d66..a8ca1d0 100644
--- a/libstdc++-v3/testsuite/20_util/optional/constexpr/in_place.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/constexpr/in_place.cc
@@ -1,5 +1,5 @@
 // { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 }  }
 
 // Copyright (C) 2013-2018 Free Software Foundation, Inc.
 //
diff --git a/libstdc++-v3/testsuite/20_util/optional/constexpr/nullopt.cc b/libstdc++-v3/testsuite/20_util/optional/constexpr/nullopt.cc
index 69842c1..6f29b3d 100644
--- a/libstdc++-v3/testsuite/20_util/optional/constexpr/nullopt.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/constexpr/nullopt.cc
@@ -1,5 +1,5 @@
 // { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 }  }
 
 // Copyright (C) 2013-2018 Free Software Foundation, Inc.
 //
diff --git a/libstdc++-v3/testsuite/20_util/optional/constexpr/observers/1.cc b/libstdc++-v3/testsuite/20_util/optional/constexpr/observers/1.cc
index 5dd8af6..c1b824c 100644
--- a/libstdc++-v3/testsuite/20_util/optional/constexpr/observers/1.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/constexpr/observers/1.cc
@@ -1,5 +1,5 @@
 // { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 }  }
 
 // Copyright (C) 2013-2018 Free Software Foundation, Inc.
 //
diff --git a/libstdc++-v3/testsuite/20_util/optional/constexpr/observers/4.cc b/libstdc++-v3/testsuite/20_util/optional/constexpr/observers/4.cc
index 7743221..3c83a3d 100644
--- a/libstdc++-v3/testsuite/20_util/optional/constexpr/observers/4.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/constexpr/observers/4.cc
@@ -1,5 +1,5 @@
 // { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 }  }
 
 // Copyright (C) 2013-2018 Free Software Foundation, Inc.
 //
diff --git a/libstdc++-v3/testsuite/20_util/optional/constexpr/observers/5.cc b/libstdc++-v3/testsuite/20_util/optional/constexpr/observers/5.cc
index 7cf5ecd..07595d0 100644
--- a/libstdc++-v3/testsuite/20_util/optional/constexpr/observers/5.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/constexpr/observers/5.cc
@@ -1,5 +1,5 @@
 // { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 }  }
 
 // Copyright (C) 2013-2018 Free Software Foundation, Inc.
 //
diff --git a/libstdc++-v3/testsuite/20_util/optional/constexpr/relops/1.cc b/libstdc++-v3/testsuite/20_util/optional/constexpr/relops/1.cc
index 4d2cf82..93655df 100644
--- a/libstdc++-v3/testsuite/20_util/optional/constexpr/relops/1.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/constexpr/relops/1.cc
@@ -1,5 +1,5 @@
 // { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 }  }
 
 // Copyright (C) 2013-2018 Free Software Foundation, Inc.
 //
diff --git a/libstdc++-v3/testsuite/20_util/optional/constexpr/relops/2.cc b/libstdc++-v3/testsuite/20_util/optional/constexpr/relops/2.cc
index 849ddd9..a4e3567 100644
--- a/libstdc++-v3/testsuite/20_util/optional/constexpr/relops/2.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/constexpr/relops/2.cc
@@ -1,5 +1,5 @@
 // { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 }  }
 
 // Copyright (C) 2013-2018 Free Software Foundation, Inc.
 //
diff --git a/libstdc++-v3/testsuite/20_util/optional/constexpr/relops/3.cc b/libstdc++-v3/testsuite/20_util/optional/constexpr/relops/3.cc
index 40a71b7..b40137f 100644
--- a/libstdc++-v3/testsuite/20_util/optional/constexpr/relops/3.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/constexpr/relops/3.cc
@@ -1,5 +1,5 @@
 // { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 }  }
 
 // Copyright (C) 2013-2018 Free Software Foundation, Inc.
 //
diff --git a/libstdc++-v3/testsuite/20_util/optional/constexpr/relops/4.cc b/libstdc++-v3/testsuite/20_util/optional/constexpr/relops/4.cc
index 2a39c79..ad60ea2 100644
--- a/libstdc++-v3/testsuite/20_util/optional/constexpr/relops/4.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/constexpr/relops/4.cc
@@ -1,5 +1,5 @@
 // { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 }  }
 
 // Copyright (C) 2013-2018 Free Software Foundation, Inc.
 //
diff --git a/libstdc++-v3/testsuite/20_util/optional/constexpr/relops/5.cc b/libstdc++-v3/testsuite/20_util/optional/constexpr/relops/5.cc
index 3561553..a896d9b 100644
--- a/libstdc++-v3/testsuite/20_util/optional/constexpr/relops/5.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/constexpr/relops/5.cc
@@ -1,5 +1,5 @@
 // { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 }  }
 
 // Copyright (C) 2013-2018 Free Software Foundation, Inc.
 //
diff --git a/libstdc++-v3/testsuite/20_util/optional/constexpr/relops/6.cc b/libstdc++-v3/testsuite/20_util/optional/constexpr/relops/6.cc
index f716b5f..d22bbe7 100644
--- a/libstdc++-v3/testsuite/20_util/optional/constexpr/relops/6.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/constexpr/relops/6.cc
@@ -1,5 +1,5 @@
 // { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 }  }
 
 // Copyright (C) 2013-2018 Free Software Foundation, Inc.
 //
diff --git a/libstdc++-v3/testsuite/20_util/optional/in_place.cc b/libstdc++-v3/testsuite/20_util/optional/in_place.cc
index d1e91d2..d8b0e2f 100644
--- a/libstdc++-v3/testsuite/20_util/optional/in_place.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/in_place.cc
@@ -1,5 +1,5 @@
 // { dg-options "-std=gnu++17" }
-// { dg-do run }
+// { dg-do run { target c++17 }  }
 
 // Copyright (C) 2013-2018 Free Software Foundation, Inc.
 //
diff --git a/libstdc++-v3/testsuite/20_util/optional/make_optional.cc b/libstdc++-v3/testsuite/20_util/optional/make_optional.cc
index 75541c9..ce5bf56 100644
--- a/libstdc++-v3/testsuite/20_util/optional/make_optional.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/make_optional.cc
@@ -1,5 +1,5 @@
 // { dg-options "-std=gnu++17" }
-// { dg-do run }
+// { dg-do run { target c++17 }  }
 
 // Copyright (C) 2013-2018 Free Software Foundation, Inc.
 //
diff --git a/libstdc++-v3/testsuite/20_util/optional/nullopt.cc b/libstdc++-v3/testsuite/20_util/optional/nullopt.cc
index 3440bf5..8cc8240 100644
--- a/libstdc++-v3/testsuite/20_util/optional/nullopt.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/nullopt.cc
@@ -1,5 +1,5 @@
 // { dg-options "-std=gnu++17" }
-// { dg-do run }
+// { dg-do run { target c++17 }  }
 
 // Copyright (C) 2013-2018 Free Software Foundation, Inc.
 //
diff --git a/libstdc++-v3/testsuite/20_util/optional/observers/1.cc b/libstdc++-v3/testsuite/20_util/optional/observers/1.cc
index bc84f27..17ec0fd 100644
--- a/libstdc++-v3/testsuite/20_util/optional/observers/1.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/observers/1.cc
@@ -1,5 +1,5 @@
 // { dg-options "-std=gnu++17" }
-// { dg-do run }
+// { dg-do run { target c++17 }  }
 
 // Copyright (C) 2013-2018 Free Software Foundation, Inc.
 //
diff --git a/libstdc++-v3/testsuite/20_util/optional/observers/2.cc b/libstdc++-v3/testsuite/20_util/optional/observers/2.cc
index 4af183e..4089b06 100644
--- a/libstdc++-v3/testsuite/20_util/optional/observers/2.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/observers/2.cc
@@ -1,5 +1,5 @@
 // { dg-options "-std=gnu++17" }
-// { dg-do run }
+// { dg-do run { target c++17 }  }
 
 // Copyright (C) 2013-2018 Free Software Foundation, Inc.
 //
diff --git a/libstdc++-v3/testsuite/20_util/optional/observers/3.cc b/libstdc++-v3/testsuite/20_util/optional/observers/3.cc
index 6f71fb8..d4dd187 100644
--- a/libstdc++-v3/testsuite/20_util/optional/observers/3.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/observers/3.cc
@@ -1,5 +1,5 @@
 // { dg-options "-std=gnu++17" }
-// { dg-do run }
+// { dg-do run { target c++17 }  }
 
 // Copyright (C) 2013-2018 Free Software Foundation, Inc.
 //
diff --git a/libstdc++-v3/testsuite/20_util/optional/observers/4.cc b/libstdc++-v3/testsuite/20_util/optional/observers/4.cc
index ac8515f..e36e5f1 100644
--- a/libstdc++-v3/testsuite/20_util/optional/observers/4.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/observers/4.cc
@@ -1,5 +1,5 @@
 // { dg-options "-std=gnu++17" }
-// { dg-do run }
+// { dg-do run { target c++17 }  }
 
 // Copyright (C) 2013-2018 Free Software Foundation, Inc.
 //
diff --git a/libstdc++-v3/testsuite/20_util/optional/observers/5.cc b/libstdc++-v3/testsuite/20_util/optional/observers/5.cc
index bcf6c38..7e526e3 100644
--- a/libstdc++-v3/testsuite/20_util/optional/observers/5.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/observers/5.cc
@@ -1,5 +1,5 @@
 // { dg-options "-std=gnu++17" }
-// { dg-do run }
+// { dg-do run { target c++17 }  }
 
 // Copyright (C) 2013-2018 Free Software Foundation, Inc.
 //
diff --git a/libstdc++-v3/testsuite/20_util/optional/observers/6.cc b/libstdc++-v3/testsuite/20_util/optional/observers/6.cc
index d84007b..af7c692 100644
--- a/libstdc++-v3/testsuite/20_util/optional/observers/6.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/observers/6.cc
@@ -1,5 +1,5 @@
 // { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 }  }
 
 // Copyright (C) 2016-2018 Free Software Foundation, Inc.
 //
diff --git a/libstdc++-v3/testsuite/20_util/optional/relops/1.cc b/libstdc++-v3/testsuite/20_util/optional/relops/1.cc
index 78d53dc..7a74405 100644
--- a/libstdc++-v3/testsuite/20_util/optional/relops/1.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/relops/1.cc
@@ -1,5 +1,5 @@
 // { dg-options "-std=gnu++17" }
-// { dg-do run }
+// { dg-do run { target c++17 }  }
 
 // Copyright (C) 2013-2018 Free Software Foundation, Inc.
 //
diff --git a/libstdc++-v3/testsuite/20_util/optional/relops/2.cc b/libstdc++-v3/testsuite/20_util/optional/relops/2.cc
index 4c8e958..fce9046 100644
--- a/libstdc++-v3/testsuite/20_util/optional/relops/2.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/relops/2.cc
@@ -1,5 +1,5 @@
 // { dg-options "-std=gnu++17" }
-// { dg-do run }
+// { dg-do run { target c++17 }  }
 
 // Copyright (C) 2013-2018 Free Software Foundation, Inc.
 //
diff --git a/libstdc++-v3/testsuite/20_util/optional/relops/3.cc b/libstdc++-v3/testsuite/20_util/optional/relops/3.cc
index 5b7f5a1..c2032c3 100644
--- a/libstdc++-v3/testsuite/20_util/optional/relops/3.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/relops/3.cc
@@ -1,5 +1,5 @@
 // { dg-options "-std=gnu++17" }
-// { dg-do run }
+// { dg-do run { target c++17 }  }
 
 // Copyright (C) 2013-2018 Free Software Foundation, Inc.
 //
diff --git a/libstdc++-v3/testsuite/20_util/optional/relops/4.cc b/libstdc++-v3/testsuite/20_util/optional/relops/4.cc
index 69ab273..686c6f5 100644
--- a/libstdc++-v3/testsuite/20_util/optional/relops/4.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/relops/4.cc
@@ -1,5 +1,5 @@
 // { dg-options "-std=gnu++17" }
-// { dg-do run }
+// { dg-do run { target c++17 }  }
 
 // Copyright (C) 2013-2018 Free Software Foundation, Inc.
 //
diff --git a/libstdc++-v3/testsuite/20_util/optional/relops/5.cc b/libstdc++-v3/testsuite/20_util/optional/relops/5.cc
index 3510d18..838cefe 100644
--- a/libstdc++-v3/testsuite/20_util/optional/relops/5.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/relops/5.cc
@@ -1,5 +1,5 @@
 // { dg-options "-std=gnu++17" }
-// { dg-do run }
+// { dg-do run { target c++17 }  }
 
 // Copyright (C) 2013-2018 Free Software Foundation, Inc.
 //
diff --git a/libstdc++-v3/testsuite/20_util/optional/relops/6.cc b/libstdc++-v3/testsuite/20_util/optional/relops/6.cc
index 1d6ecae..f7f94b0 100644
--- a/libstdc++-v3/testsuite/20_util/optional/relops/6.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/relops/6.cc
@@ -1,5 +1,5 @@
 // { dg-options "-std=gnu++17" }
-// { dg-do run }
+// { dg-do run { target c++17 }  }
 
 // Copyright (C) 2013-2018 Free Software Foundation, Inc.
 //
diff --git a/libstdc++-v3/testsuite/20_util/optional/relops/7.cc b/libstdc++-v3/testsuite/20_util/optional/relops/7.cc
index 05f9c72..3048152 100644
--- a/libstdc++-v3/testsuite/20_util/optional/relops/7.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/relops/7.cc
@@ -1,5 +1,5 @@
 // { dg-options "-std=gnu++17" }
-// { dg-do run }
+// { dg-do run { target c++17 }  }
 
 // Copyright (C) 2017-2018 Free Software Foundation, Inc.
 //
diff --git a/libstdc++-v3/testsuite/20_util/optional/requirements.cc b/libstdc++-v3/testsuite/20_util/optional/requirements.cc
index 14c97ee..f15ab0d 100644
--- a/libstdc++-v3/testsuite/20_util/optional/requirements.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/requirements.cc
@@ -1,5 +1,5 @@
 // { dg-options "-std=gnu++17" }
-// { dg-do run }
+// { dg-do run { target c++17 }  }
 
 // Copyright (C) 2013-2018 Free Software Foundation, Inc.
 //
diff --git a/libstdc++-v3/testsuite/20_util/optional/swap/1.cc b/libstdc++-v3/testsuite/20_util/optional/swap/1.cc
index 3fc2db8..c0662f9 100644
--- a/libstdc++-v3/testsuite/20_util/optional/swap/1.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/swap/1.cc
@@ -1,5 +1,5 @@
 // { dg-options "-std=gnu++17" }
-// { dg-do run }
+// { dg-do run { target c++17 }  }
 
 // Copyright (C) 2013-2018 Free Software Foundation, Inc.
 //
diff --git a/libstdc++-v3/testsuite/20_util/optional/swap/2.cc b/libstdc++-v3/testsuite/20_util/optional/swap/2.cc
index f2e285e..d74561f 100644
--- a/libstdc++-v3/testsuite/20_util/optional/swap/2.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/swap/2.cc
@@ -1,5 +1,5 @@
 // { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 }  }
 
 // Copyright (C) 2016-2018 Free Software Foundation, Inc.
 //
diff --git a/libstdc++-v3/testsuite/20_util/optional/typedefs.cc b/libstdc++-v3/testsuite/20_util/optional/typedefs.cc
index 501160b..34d5b93 100644
--- a/libstdc++-v3/testsuite/20_util/optional/typedefs.cc
+++ b/libstdc++-v3/testsuite/20_util/optional/typedefs.cc
@@ -1,5 +1,5 @@
 // { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 }  }
 
 // Copyright (C) 2014-2018 Free Software Foundation, Inc.
 //
