diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-mangle.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-mangle.C
index 20ef282..15b8b79 100644
--- a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-mangle.C
+++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-mangle.C
@@ -1,6 +1,6 @@
 // Test lambda mangling
-// { dg-require-weak "" }
 // { dg-do compile { target c++11 } }
+// { dg-require-weak "" }
 // { dg-options "-fno-inline" }
 
 template<typename F> int algo(F fn) { return fn(); }
diff --git a/gcc/testsuite/g++.dg/ext/builtin_alloca.C b/gcc/testsuite/g++.dg/ext/builtin_alloca.C
index 7a0d331..e857502 100644
--- a/gcc/testsuite/g++.dg/ext/builtin_alloca.C
+++ b/gcc/testsuite/g++.dg/ext/builtin_alloca.C
@@ -1,7 +1,7 @@
 // PR middle-end/69780 - [4.9/5/6 Regression] ICE on
 //     __builtin_alloca_with_align with small alignment
-// { dg-require-effective-target alloca }
 // { dg-do compile }
+// { dg-require-effective-target alloca }
 
 #define CHAR_BIT  __CHAR_BIT__
 #define SIZE_MAX  __SIZE_MAX__
diff --git a/gcc/testsuite/g++.dg/template/spec35.C b/gcc/testsuite/g++.dg/template/spec35.C
index 709ece5..e82323c 100644
--- a/gcc/testsuite/g++.dg/template/spec35.C
+++ b/gcc/testsuite/g++.dg/template/spec35.C
@@ -2,8 +2,8 @@
 // C++ DR 605 -- "...the linkage of an explicit specialization must be that of
 // the template."
 
-// { dg-require-weak "" }
 // { dg-do compile { target i?86-*-* x86_64-*-* } }
+// { dg-require-weak "" }
 
 template<class T>
 static void f1 (T) { }
diff --git a/gcc/testsuite/gcc.dg/builtins-68.c b/gcc/testsuite/gcc.dg/builtins-68.c
index c0cc1eb..1247394 100644
--- a/gcc/testsuite/gcc.dg/builtins-68.c
+++ b/gcc/testsuite/gcc.dg/builtins-68.c
@@ -1,7 +1,7 @@
 /* PR middle-end/69780 - [4.9/5/6 Regression] ICE on
      __builtin_alloca_with_align with small alignment */
-/* { dg-require-effective-target alloca } */
 /* { dg-do compile } */
+/* { dg-require-effective-target alloca } */
 /* { dg-options "-Wno-long-long" } */
 
 #define CHAR_BIT  __CHAR_BIT__
diff --git a/gcc/testsuite/gcc.misc-tests/gcov-13.c b/gcc/testsuite/gcc.misc-tests/gcov-13.c
index e443f48..2c80559 100644
--- a/gcc/testsuite/gcc.misc-tests/gcov-13.c
+++ b/gcc/testsuite/gcc.misc-tests/gcov-13.c
@@ -1,8 +1,8 @@
 /* Test gcov weak ellision.  */
 
+/* { dg-do run { target native } } */
 /* { dg-options "-fprofile-arcs -ftest-coverage" } */
 /* { dg-require-weak "" } */
-/* { dg-do run { target native } } */
 /* { dg-additional-sources "gcovpart-13b.c" } */
 /* { dg-skip-if "weak ellision not supported" { { hppa*-*-hpux* } && { ! lp64 } } { "*" } { "" } } */
 
diff --git a/gcc/testsuite/gcc.misc-tests/gcov-14.c b/gcc/testsuite/gcc.misc-tests/gcov-14.c
index 78dd7be..2bebf7e 100644
--- a/gcc/testsuite/gcc.misc-tests/gcov-14.c
+++ b/gcc/testsuite/gcc.misc-tests/gcov-14.c
@@ -1,10 +1,10 @@
 /* Test gcov extern inline.  */
 
+/* { dg-do run { target native } } */
 /* { dg-options "-O2 -fprofile-arcs -ftest-coverage -fgnu89-inline" } */
 /* The following line arranges that Darwin has behavior like elf weak import.  */
 /* { dg-additional-options "-flat_namespace -undefined suppress" { target *-*-darwin* }  } */
 /* { dg-require-weak "" } */
-/* { dg-do run { target native } } */
 /* { dg-skip-if "undefined weak not supported" { { hppa*-*-hpux* } && { ! lp64 } } } */
 /* { dg-skip-if "undefined weak not supported" { powerpc-ibm-aix* } } */
 
diff --git a/libstdc++-v3/testsuite/21_strings/debug/iterator_self_move_assign_neg.cc b/libstdc++-v3/testsuite/21_strings/debug/iterator_self_move_assign_neg.cc
index 6d10bb1..f481115 100644
--- a/libstdc++-v3/testsuite/21_strings/debug/iterator_self_move_assign_neg.cc
+++ b/libstdc++-v3/testsuite/21_strings/debug/iterator_self_move_assign_neg.cc
@@ -15,9 +15,9 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 //
+// { dg-do run { xfail *-*-* } }
 // { dg-require-debug-mode "" }
 // { dg-options "-std=gnu++11" }
-// { dg-do run { xfail *-*-* } }
 
 #include <debug/string>
 
diff --git a/libstdc++-v3/testsuite/21_strings/debug/self_move_assign_neg.cc b/libstdc++-v3/testsuite/21_strings/debug/self_move_assign_neg.cc
index 360f077..a72cb87 100644
--- a/libstdc++-v3/testsuite/21_strings/debug/self_move_assign_neg.cc
+++ b/libstdc++-v3/testsuite/21_strings/debug/self_move_assign_neg.cc
@@ -15,9 +15,9 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 //
+// { dg-do run { xfail *-*-* } }
 // { dg-require-debug-mode "" }
 // { dg-options "-std=gnu++11" }
-// { dg-do run { xfail *-*-* } }
 
 #include <debug/string>
 
diff --git a/libstdc++-v3/testsuite/23_containers/vector/bool/modifiers/insert/31370.cc b/libstdc++-v3/testsuite/23_containers/vector/bool/modifiers/insert/31370.cc
index bcd548c..fd94c78 100644
--- a/libstdc++-v3/testsuite/23_containers/vector/bool/modifiers/insert/31370.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector/bool/modifiers/insert/31370.cc
@@ -17,8 +17,8 @@
 
 // 23.2.5 class vector<bool> [lib.vector.bool]
 
-// { dg-skip-if "" { powerpc64-*-freebsd* } { "*" } { "" } }
 // { dg-do run { xfail *-*-darwin8.[0-4].* } }
+// { dg-skip-if "" { powerpc64-*-freebsd* } { "*" } { "" } }
 
 #include <vector>
 #include <stdexcept>
diff --git a/libstdc++-v3/testsuite/23_containers/vector/debug/57779_neg.cc b/libstdc++-v3/testsuite/23_containers/vector/debug/57779_neg.cc
index d0fb7fc..bb9b35e 100644
--- a/libstdc++-v3/testsuite/23_containers/vector/debug/57779_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector/debug/57779_neg.cc
@@ -15,8 +15,8 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 //
-// { dg-require-debug-mode "" }
 // { dg-do run { xfail *-*-* } }
+// { dg-require-debug-mode "" }
 
 #include <vector>
 
diff --git a/libstdc++-v3/testsuite/23_containers/vector/debug/60587_neg.cc b/libstdc++-v3/testsuite/23_containers/vector/debug/60587_neg.cc
index ae205be..51ebc84 100644
--- a/libstdc++-v3/testsuite/23_containers/vector/debug/60587_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector/debug/60587_neg.cc
@@ -15,8 +15,8 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 //
-// { dg-require-debug-mode "" }
 // { dg-do run { xfail *-*-* } }
+// { dg-require-debug-mode "" }
 
 // PR libstdc++/60587
 
diff --git a/libstdc++-v3/testsuite/23_containers/vector/debug/assign1_neg.cc b/libstdc++-v3/testsuite/23_containers/vector/debug/assign1_neg.cc
index 9b0866d..9ee2067 100644
--- a/libstdc++-v3/testsuite/23_containers/vector/debug/assign1_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector/debug/assign1_neg.cc
@@ -15,8 +15,8 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 //
-// { dg-require-debug-mode "" }
 // { dg-do run { xfail *-*-* } }
+// { dg-require-debug-mode "" }
 
 #include <vector>
 #include <debug/checks.h>
diff --git a/libstdc++-v3/testsuite/23_containers/vector/debug/assign2_neg.cc b/libstdc++-v3/testsuite/23_containers/vector/debug/assign2_neg.cc
index aca8657..974c80a 100644
--- a/libstdc++-v3/testsuite/23_containers/vector/debug/assign2_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector/debug/assign2_neg.cc
@@ -15,8 +15,8 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 //
-// { dg-require-debug-mode "" }
 // { dg-do run { xfail *-*-* } }
+// { dg-require-debug-mode "" }
 
 #include <vector>
 #include <debug/checks.h>
diff --git a/libstdc++-v3/testsuite/23_containers/vector/debug/assign3_neg.cc b/libstdc++-v3/testsuite/23_containers/vector/debug/assign3_neg.cc
index a6c36bb..ac4aabd 100644
--- a/libstdc++-v3/testsuite/23_containers/vector/debug/assign3_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector/debug/assign3_neg.cc
@@ -15,8 +15,8 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 //
-// { dg-require-debug-mode "" }
 // { dg-do run { xfail *-*-* } }
+// { dg-require-debug-mode "" }
 
 #include <vector>
 #include <debug/checks.h>
diff --git a/libstdc++-v3/testsuite/23_containers/vector/debug/construct1_neg.cc b/libstdc++-v3/testsuite/23_containers/vector/debug/construct1_neg.cc
index 723cce0..0e51ca3 100644
--- a/libstdc++-v3/testsuite/23_containers/vector/debug/construct1_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector/debug/construct1_neg.cc
@@ -15,8 +15,8 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 //
-// { dg-require-debug-mode "" }
 // { dg-do run { xfail *-*-* } }
+// { dg-require-debug-mode "" }
 
 #include <vector>
 #include <debug/checks.h>
diff --git a/libstdc++-v3/testsuite/23_containers/vector/debug/construct2_neg.cc b/libstdc++-v3/testsuite/23_containers/vector/debug/construct2_neg.cc
index 24e659f..5c91dad 100644
--- a/libstdc++-v3/testsuite/23_containers/vector/debug/construct2_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector/debug/construct2_neg.cc
@@ -15,8 +15,8 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 //
-// { dg-require-debug-mode "" }
 // { dg-do run { xfail *-*-* } }
+// { dg-require-debug-mode "" }
 
 #include <vector>
 #include <debug/checks.h>
diff --git a/libstdc++-v3/testsuite/23_containers/vector/debug/construct3_neg.cc b/libstdc++-v3/testsuite/23_containers/vector/debug/construct3_neg.cc
index 245c6bf..63b3e1a 100644
--- a/libstdc++-v3/testsuite/23_containers/vector/debug/construct3_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector/debug/construct3_neg.cc
@@ -15,8 +15,8 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 //
-// { dg-require-debug-mode "" }
 // { dg-do run { xfail *-*-* } }
+// { dg-require-debug-mode "" }
 
 #include <vector>
 #include <debug/checks.h>
diff --git a/libstdc++-v3/testsuite/23_containers/vector/debug/insert1_neg.cc b/libstdc++-v3/testsuite/23_containers/vector/debug/insert1_neg.cc
index c43e3ad..9d09983 100644
--- a/libstdc++-v3/testsuite/23_containers/vector/debug/insert1_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector/debug/insert1_neg.cc
@@ -15,8 +15,8 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 //
-// { dg-require-debug-mode "" }
 // { dg-do run { xfail *-*-* } }
+// { dg-require-debug-mode "" }
 
 #include <vector>
 #include <debug/checks.h>
diff --git a/libstdc++-v3/testsuite/23_containers/vector/debug/insert2_neg.cc b/libstdc++-v3/testsuite/23_containers/vector/debug/insert2_neg.cc
index 80b8e17..4d8632c 100644
--- a/libstdc++-v3/testsuite/23_containers/vector/debug/insert2_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector/debug/insert2_neg.cc
@@ -15,8 +15,8 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 //
-// { dg-require-debug-mode "" }
 // { dg-do run { xfail *-*-* } }
+// { dg-require-debug-mode "" }
 
 #include <vector>
 #include <debug/checks.h>
diff --git a/libstdc++-v3/testsuite/23_containers/vector/debug/insert3_neg.cc b/libstdc++-v3/testsuite/23_containers/vector/debug/insert3_neg.cc
index 000643d..6514cca 100644
--- a/libstdc++-v3/testsuite/23_containers/vector/debug/insert3_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector/debug/insert3_neg.cc
@@ -15,8 +15,8 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 //
-// { dg-require-debug-mode "" }
 // { dg-do run { xfail *-*-* } }
+// { dg-require-debug-mode "" }
 
 #include <vector>
 #include <debug/checks.h>
diff --git a/libstdc++-v3/testsuite/23_containers/vector/debug/insert5_neg.cc b/libstdc++-v3/testsuite/23_containers/vector/debug/insert5_neg.cc
index ee65e6f..1cb29ec 100644
--- a/libstdc++-v3/testsuite/23_containers/vector/debug/insert5_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector/debug/insert5_neg.cc
@@ -15,8 +15,8 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 //
-// { dg-require-debug-mode "" }
 // { dg-do run { xfail *-*-* } }
+// { dg-require-debug-mode "" }
 
 #include <vector>
 #include <debug/checks.h>
diff --git a/libstdc++-v3/testsuite/25_algorithms/lower_bound/debug/irreflexive.cc b/libstdc++-v3/testsuite/25_algorithms/lower_bound/debug/irreflexive.cc
index 1554df0..08a3170 100644
--- a/libstdc++-v3/testsuite/25_algorithms/lower_bound/debug/irreflexive.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/lower_bound/debug/irreflexive.cc
@@ -15,8 +15,8 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 //
-// { dg-require-debug-mode "" }
 // { dg-do compile }
+// { dg-require-debug-mode "" }
 
 #include <algorithm>
 
diff --git a/libstdc++-v3/testsuite/25_algorithms/partial_sort_copy/debug/irreflexive_neg.cc b/libstdc++-v3/testsuite/25_algorithms/partial_sort_copy/debug/irreflexive_neg.cc
index 1ebc3bd..52076aa 100644
--- a/libstdc++-v3/testsuite/25_algorithms/partial_sort_copy/debug/irreflexive_neg.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/partial_sort_copy/debug/irreflexive_neg.cc
@@ -15,8 +15,8 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 //
-// { dg-require-debug-mode "" }
 // { dg-do run { xfail *-*-* } }
+// { dg-require-debug-mode "" }
 
 #include <algorithm>
 
diff --git a/libstdc++-v3/testsuite/25_algorithms/pop_heap/empty2_neg.cc b/libstdc++-v3/testsuite/25_algorithms/pop_heap/empty2_neg.cc
index e30533f..5bc2d99 100644
--- a/libstdc++-v3/testsuite/25_algorithms/pop_heap/empty2_neg.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/pop_heap/empty2_neg.cc
@@ -17,8 +17,8 @@
 
 // 25.3.6 Heap operations [lib.alg.heap.operations]
 
-// { dg-require-debug-mode "" }
 // { dg-do run { xfail *-*-* } }
+// { dg-require-debug-mode "" }
 
 #include <algorithm>
 #include <functional>
diff --git a/libstdc++-v3/testsuite/25_algorithms/pop_heap/empty_neg.cc b/libstdc++-v3/testsuite/25_algorithms/pop_heap/empty_neg.cc
index 358fb90..96c1ab9 100644
--- a/libstdc++-v3/testsuite/25_algorithms/pop_heap/empty_neg.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/pop_heap/empty_neg.cc
@@ -17,8 +17,8 @@
 
 // 25.3.6 Heap operations [lib.alg.heap.operations]
 
-// { dg-require-debug-mode "" }
 // { dg-do run { xfail *-*-* } }
+// { dg-require-debug-mode "" }
 
 #include <algorithm>
 
diff --git a/libstdc++-v3/testsuite/27_io/objects/char/12048-5.cc b/libstdc++-v3/testsuite/27_io/objects/char/12048-5.cc
index 40cf752..582ba35 100644
--- a/libstdc++-v3/testsuite/27_io/objects/char/12048-5.cc
+++ b/libstdc++-v3/testsuite/27_io/objects/char/12048-5.cc
@@ -22,9 +22,8 @@
 // equivalent and interchangable. Currently however, cin.rdbuf()->sungetc()
 // only returns characters that were read with cin.rdbuf()->sbumpc()
 
-// { dg-require-fileio "" }
-
 // { dg-do run { xfail *-*-* } }
+// { dg-require-fileio "" }
 
 #include <iostream>
 #include <cstdio>
diff --git a/libstdc++-v3/testsuite/ext/special_functions/conf_hyperg/check_nan.cc b/libstdc++-v3/testsuite/ext/special_functions/conf_hyperg/check_nan.cc
index d6108d5..6c4f8fa 100644
--- a/libstdc++-v3/testsuite/ext/special_functions/conf_hyperg/check_nan.cc
+++ b/libstdc++-v3/testsuite/ext/special_functions/conf_hyperg/check_nan.cc
@@ -1,7 +1,7 @@
+// { dg-do run { target c++11 } }
 // { dg-require-c-std "" }
 // { dg-add-options ieee }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
-// { dg-do run { target c++11 } }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
 //
diff --git a/libstdc++-v3/testsuite/ext/special_functions/hyperg/check_nan.cc b/libstdc++-v3/testsuite/ext/special_functions/hyperg/check_nan.cc
index 8806a3c..31b81a6 100644
--- a/libstdc++-v3/testsuite/ext/special_functions/hyperg/check_nan.cc
+++ b/libstdc++-v3/testsuite/ext/special_functions/hyperg/check_nan.cc
@@ -1,7 +1,7 @@
+// { dg-do run { target c++11 } }
 // { dg-require-c-std "" }
 // { dg-add-options ieee }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
-// { dg-do run { target c++11 } }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
 //
