diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/2.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/2.cc
index aa2e1560178..c76631666f4 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/2.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/2.cc
@@ -19,7 +19,9 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 27.8.1.4 Overridden virtual functions
+// C++98 27.8.1.4 Overridden virtual functions
+
+// { dg-additional-files "filebuf_virtuals-1.txt" }
 
 #include <fstream>
 #include <locale>
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/wchar_t/2.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/wchar_t/2.cc
index 92faee0766d..ad119deb33f 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/wchar_t/2.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/wchar_t/2.cc
@@ -1,4 +1,5 @@
 // { dg-require-namedlocale "de_DE.ISO8859-15" }
+// { dg-additional-files "filebuf_virtuals-1.txt" }
 
 // 2003-05-13 Benjamin Kosnik  <bkoz@redhat.com>
 
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/path.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/path.cc
index 0df22f2a47e..81e15e289b4 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/path.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/path.cc
@@ -19,6 +19,7 @@
 // { dg-do run { target c++17 } }
 // { dg-require-fileio "" }
 // { dg-require-filesystem-ts "" }
+// { dg-additional-files "filebuf_members-1.tst" }
 
 #include <fstream>
 #include <filesystem>
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/pbackfail/char/9761.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/pbackfail/char/9761.cc
index e074bd8899b..e02a004a506 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/pbackfail/char/9761.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/pbackfail/char/9761.cc
@@ -20,6 +20,7 @@
 // 27.8.1.4 Overridden virtual functions
 
 // { dg-require-fileio "" }
+// { dg-additional-files "filebuf_virtuals-1.txt" }
 
 #include <fstream>
 #include <testsuite_hooks.h>
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/3-in.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/3-in.cc
index 6ca42a2dbdf..6403a8e643c 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/3-in.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/3-in.cc
@@ -17,9 +17,10 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 27.7.1.3 Overridden virtual functions
+// C++98 27.8.1.4 Overridden virtual functions
 
 // { dg-require-fileio "" }
+// { dg-additional-files "filebuf_virtuals-1.tst filebuf_members-1.tst" }
 
 #include <fstream>
 #include <testsuite_hooks.h>
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/3-io.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/3-io.cc
index 853eec405da..2cea0145d1a 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/3-io.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/3-io.cc
@@ -17,9 +17,10 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 27.7.1.3 Overridden virtual functions
+// C++98 27.8.1.4 Overridden virtual functions
 
 // { dg-require-fileio "" }
+// { dg-additional-files "filebuf_virtuals-1.tst filebuf_members-1.tst" }
 
 #include <fstream>
 #include <testsuite_hooks.h>
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/3-in.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/3-in.cc
index 4124dd84fc5..b91845476a8 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/3-in.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/3-in.cc
@@ -20,6 +20,7 @@
 // 27.7.1.3 Overridden virtual functions
 
 // { dg-require-fileio "" }
+// { dg-additional-files "filebuf_virtuals-1.tst filebuf_members-1.tst" }
 
 #include <fstream>
 #include <testsuite_hooks.h>
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/3-io.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/3-io.cc
index f4bf73f46e4..c89f9bccec1 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/3-io.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/3-io.cc
@@ -20,6 +20,7 @@
 // 27.7.1.3 Overridden virtual functions
 
 // { dg-require-fileio "" }
+// { dg-additional-files "filebuf_virtuals-1.tst filebuf_members-1.tst" }
 
 #include <fstream>
 #include <testsuite_hooks.h>
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/setbuf/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/setbuf/char/1.cc
index 7b77394cfaf..ca60379ef1f 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/setbuf/char/1.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/setbuf/char/1.cc
@@ -20,6 +20,7 @@
 // 27.8.1.4 Overridden virtual functions
 
 // { dg-require-fileio "" }
+// { dg-additional-files "filebuf_virtuals-1.txt" }
 
 #include <fstream>
 #include <testsuite_hooks.h>
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/3.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/3.cc
index 699875c5dd9..cf5c7c8bd4d 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/3.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/3.cc
@@ -20,6 +20,7 @@
 // 27.8.1.4 Overridden virtual functions
 
 // { dg-require-fileio "" }
+// { dg-additional-files "sgetn.txt" }
 
 #include <fstream>
 #include <testsuite_hooks.h>
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/10096.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/10096.cc
index b7a9d4d644a..02b4ab65590 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/10096.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/10096.cc
@@ -20,6 +20,7 @@
 // 27.8.1.4 Overridden virtual functions
 
 // { dg-require-fileio "" }
+// { dg-additional-files "filebuf_virtuals-1.txt" }
 
 #include <fstream>
 #include <string>
diff --git a/libstdc++-v3/testsuite/27_io/basic_fstream/cons/char/path.cc b/libstdc++-v3/testsuite/27_io/basic_fstream/cons/char/path.cc
index 7fdcd2b4461..9f2865ff572 100644
--- a/libstdc++-v3/testsuite/27_io/basic_fstream/cons/char/path.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_fstream/cons/char/path.cc
@@ -19,6 +19,7 @@
 // { dg-do run { target c++17 } }
 // { dg-require-fileio "" }
 // { dg-require-filesystem-ts "" }
+// { dg-additional-files "ofstream_members-1.tst" }
 
 #include <fstream>
 #include <filesystem>
diff --git a/libstdc++-v3/testsuite/27_io/basic_fstream/open/char/path.cc b/libstdc++-v3/testsuite/27_io/basic_fstream/open/char/path.cc
index 141e614d8d1..01b149418b4 100644
--- a/libstdc++-v3/testsuite/27_io/basic_fstream/open/char/path.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_fstream/open/char/path.cc
@@ -19,6 +19,7 @@
 // { dg-do run { target c++17 } }
 // { dg-require-fileio "" }
 // { dg-require-filesystem-ts "" }
+// { dg-additional-files "filebuf_members-1.tst" }
 
 #include <fstream>
 #include <filesystem>
diff --git a/libstdc++-v3/testsuite/27_io/basic_ifstream/assign/1.cc b/libstdc++-v3/testsuite/27_io/basic_ifstream/assign/1.cc
index e6b71b919f2..210a0870ef0 100644
--- a/libstdc++-v3/testsuite/27_io/basic_ifstream/assign/1.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_ifstream/assign/1.cc
@@ -17,8 +17,9 @@
 
 // { dg-do run { target c++11 } }
 // { dg-require-fileio "" }
+// { dg-additional-files "thirty_years_among_the_dead_preproc.txt" }
 
-// 27.9.1.8 Assign and swap [ifstream.assign]
+// C++11 27.9.1.8 Assign and swap [ifstream.assign]
 
 #include <fstream>
 #include <sstream>
diff --git a/libstdc++-v3/testsuite/27_io/basic_ifstream/cons/char/path.cc b/libstdc++-v3/testsuite/27_io/basic_ifstream/cons/char/path.cc
index bf3ebed1e07..060c2c8bcf3 100644
--- a/libstdc++-v3/testsuite/27_io/basic_ifstream/cons/char/path.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_ifstream/cons/char/path.cc
@@ -19,6 +19,7 @@
 // { dg-do run { target c++17 } }
 // { dg-require-fileio "" }
 // { dg-require-filesystem-ts "" }
+// { dg-additional-files "ifstream_members-1.tst" }
 
 #include <fstream>
 #include <filesystem>
diff --git a/libstdc++-v3/testsuite/27_io/basic_ifstream/cons/move.cc b/libstdc++-v3/testsuite/27_io/basic_ifstream/cons/move.cc
index 228965edfae..38cdb6494a3 100644
--- a/libstdc++-v3/testsuite/27_io/basic_ifstream/cons/move.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_ifstream/cons/move.cc
@@ -17,8 +17,9 @@
 
 // { dg-do run { target c++11 } }
 // { dg-require-fileio "" }
+// { dg-additional-files "thirty_years_among_the_dead_preproc.txt" }
 
-// 27.9.1.7 basic_ifstream constructors [ifstream.cons]
+// C++11 27.9.1.7 basic_ifstream constructors [ifstream.cons]
 
 #include <fstream>
 #include <sstream>
diff --git a/libstdc++-v3/testsuite/27_io/basic_ifstream/open/char/path.cc b/libstdc++-v3/testsuite/27_io/basic_ifstream/open/char/path.cc
index d58063e3d20..76a3a3d7fb9 100644
--- a/libstdc++-v3/testsuite/27_io/basic_ifstream/open/char/path.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_ifstream/open/char/path.cc
@@ -19,6 +19,7 @@
 // { dg-do run { target c++17 } }
 // { dg-require-fileio "" }
 // { dg-require-filesystem-ts "" }
+// { dg-additional-files "filebuf_members-1.tst" }
 
 #include <fstream>
 #include <filesystem>
diff --git a/libstdc++-v3/testsuite/27_io/basic_ifstream/open/wchar_t/1.cc b/libstdc++-v3/testsuite/27_io/basic_ifstream/open/wchar_t/1.cc
index 243f732c859..097d33b2a1e 100644
--- a/libstdc++-v3/testsuite/27_io/basic_ifstream/open/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_ifstream/open/wchar_t/1.cc
@@ -15,10 +15,11 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 30.9.3.1 basic_ifstream constructors [ifstream.cons]
+// C++17 30.9.3.1 basic_ifstream constructors [ifstream.cons]
 
 // { dg-do run { target *-*-mingw* } }
 // { dg-require-fileio "" }
+// { dg-additional-files "ifstream_members-1.tst" }
 
 #include <fstream>
 #include <testsuite_hooks.h>
diff --git a/libstdc++-v3/testsuite/27_io/objects/char/10.cc b/libstdc++-v3/testsuite/27_io/objects/char/10.cc
index 3f30c9939e8..726a933aafe 100644
--- a/libstdc++-v3/testsuite/27_io/objects/char/10.cc
+++ b/libstdc++-v3/testsuite/27_io/objects/char/10.cc
@@ -19,6 +19,7 @@
  
 // { dg-require-fileio "" }
 // { dg-require-binary-io "" }
+// { dg-additional-files "filebuf_virtuals-1.txt" }
 
 #include <iostream>
 #include <cstdio>
diff --git a/libstdc++-v3/testsuite/27_io/objects/char/12048-1.cc b/libstdc++-v3/testsuite/27_io/objects/char/12048-1.cc
index 4ee3a1942a3..2d1ae04500d 100644
--- a/libstdc++-v3/testsuite/27_io/objects/char/12048-1.cc
+++ b/libstdc++-v3/testsuite/27_io/objects/char/12048-1.cc
@@ -19,6 +19,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-require-fileio "" }
+// { dg-additional-files "cin_unget-1.txt" }
 
 #include <iostream>
 #include <cstdio>
diff --git a/libstdc++-v3/testsuite/27_io/objects/char/12048-2.cc b/libstdc++-v3/testsuite/27_io/objects/char/12048-2.cc
index d6a656cbb20..c0ae079e7fc 100644
--- a/libstdc++-v3/testsuite/27_io/objects/char/12048-2.cc
+++ b/libstdc++-v3/testsuite/27_io/objects/char/12048-2.cc
@@ -16,6 +16,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-require-fileio "" }
+// { dg-additional-files "cin_unget-1.txt" }
 
 #include <iostream>
 #include <cstdio>
diff --git a/libstdc++-v3/testsuite/27_io/objects/char/12048-3.cc b/libstdc++-v3/testsuite/27_io/objects/char/12048-3.cc
index 4d2dcfa8902..8a10428c124 100644
--- a/libstdc++-v3/testsuite/27_io/objects/char/12048-3.cc
+++ b/libstdc++-v3/testsuite/27_io/objects/char/12048-3.cc
@@ -16,6 +16,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-require-fileio "" }
+// { dg-additional-files "cin_unget-1.txt" }
 
 #include <iostream>
 #include <cstdio>
diff --git a/libstdc++-v3/testsuite/27_io/objects/char/12048-4.cc b/libstdc++-v3/testsuite/27_io/objects/char/12048-4.cc
index 7cabf83d82d..4daa30fd020 100644
--- a/libstdc++-v3/testsuite/27_io/objects/char/12048-4.cc
+++ b/libstdc++-v3/testsuite/27_io/objects/char/12048-4.cc
@@ -16,6 +16,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-require-fileio "" }
+// { dg-additional-files "cin_unget-1.txt" }
 
 #include <iostream>
 #include <cstdio>
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 7ddd97baef9..f579e91d3ab 100644
--- a/libstdc++-v3/testsuite/27_io/objects/char/12048-5.cc
+++ b/libstdc++-v3/testsuite/27_io/objects/char/12048-5.cc
@@ -24,6 +24,7 @@
 
 // { dg-do run { xfail *-*-* } }
 // { dg-require-fileio "" }
+// { dg-additional-files "cin_unget-1.txt" }
 
 #include <iostream>
 #include <cstdio>
diff --git a/libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-1.cc b/libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-1.cc
index 156bb01163b..434a85ded75 100644
--- a/libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-1.cc
+++ b/libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-1.cc
@@ -19,6 +19,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-require-fileio "" }
+// { dg-additional-files "cin_unget-1.txt" }
 
 #include <iostream>
 #include <cstdio>
diff --git a/libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-2.cc b/libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-2.cc
index d7ef6577db5..6d1033c4054 100644
--- a/libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-2.cc
+++ b/libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-2.cc
@@ -16,6 +16,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-require-fileio "" }
+// { dg-additional-files "cin_unget-1.txt" }
 
 #include <iostream>
 #include <cstdio>
diff --git a/libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-3.cc b/libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-3.cc
index 5a97b2e4358..f38457be7bc 100644
--- a/libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-3.cc
+++ b/libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-3.cc
@@ -19,6 +19,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-require-fileio "" }
+// { dg-additional-files "cin_unget-1.txt" }
 
 #include <iostream>
 #include <cwchar>
diff --git a/libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-4.cc b/libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-4.cc
index 7b9a99be953..58e16355887 100644
--- a/libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-4.cc
+++ b/libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-4.cc
@@ -16,6 +16,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-require-fileio "" }
+// { dg-additional-files "cin_unget-1.txt" }
 
 #include <iostream>
 #include <cstdio>
diff --git a/libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-5.cc b/libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-5.cc
index 13cd1061ef9..7efe4a2c6ef 100644
--- a/libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-5.cc
+++ b/libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-5.cc
@@ -21,6 +21,7 @@
 
 // { dg-do run { xfail *-*-* } }
 // { dg-require-fileio "" }
+// { dg-additional-files "cin_unget-1.txt" }
 
 #include <iostream>
 #include <cstdio>
diff --git a/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/char/12048-1.cc b/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/char/12048-1.cc
index abef61fa11b..ec57eaf8a8c 100644
--- a/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/char/12048-1.cc
+++ b/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/char/12048-1.cc
@@ -18,6 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-require-fileio "" }
+// { dg-additional-files "cin_unget-1.txt" }
 
 #include <ext/stdio_sync_filebuf.h>
 #include <testsuite_hooks.h>
diff --git a/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/char/12048-2.cc b/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/char/12048-2.cc
index 058b393814e..91db50b8ed5 100644
--- a/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/char/12048-2.cc
+++ b/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/char/12048-2.cc
@@ -18,6 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-require-fileio "" }
+// { dg-additional-files "cin_unget-1.txt" }
 
 #include <ext/stdio_sync_filebuf.h>
 #include <testsuite_hooks.h>
diff --git a/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/char/12048-3.cc b/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/char/12048-3.cc
index d3b89185bb0..e2f3100a22a 100644
--- a/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/char/12048-3.cc
+++ b/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/char/12048-3.cc
@@ -18,6 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-require-fileio "" }
+// { dg-additional-files "cin_unget-1.txt" }
 
 #include <ext/stdio_sync_filebuf.h>
 #include <testsuite_hooks.h>
diff --git a/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/char/12048-4.cc b/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/char/12048-4.cc
index e6076a93af2..72889fbd9b5 100644
--- a/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/char/12048-4.cc
+++ b/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/char/12048-4.cc
@@ -18,6 +18,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-require-fileio "" }
+// { dg-additional-files "cin_unget-1.txt" }
 
 #include <ext/stdio_sync_filebuf.h>
 #include <testsuite_hooks.h>
diff --git a/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/wchar_t/12948-1.cc b/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/wchar_t/12948-1.cc
index 78248942c72..e71aee29cf2 100644
--- a/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/wchar_t/12948-1.cc
+++ b/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/wchar_t/12948-1.cc
@@ -17,6 +17,8 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
+// { dg-additional-files "cin_unget-1.txt" }
+
 #include <ext/stdio_sync_filebuf.h>
 #include <testsuite_hooks.h>
 
diff --git a/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/wchar_t/12948-2.cc b/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/wchar_t/12948-2.cc
index 1be110eec6b..529353787e9 100644
--- a/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/wchar_t/12948-2.cc
+++ b/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/wchar_t/12948-2.cc
@@ -20,6 +20,8 @@
 #include <ext/stdio_sync_filebuf.h>
 #include <testsuite_hooks.h>
 
+// { dg-additional-files "cin_unget-1.txt" }
+
 // libstdc++/12048
 void test03()
 {
diff --git a/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/wchar_t/12948-3.cc b/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/wchar_t/12948-3.cc
index 51639d313c1..8274350b0e0 100644
--- a/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/wchar_t/12948-3.cc
+++ b/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/wchar_t/12948-3.cc
@@ -17,6 +17,8 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
+// { dg-additional-files "cin_unget-1.txt" }
+
 #include <ext/stdio_sync_filebuf.h>
 #include <testsuite_hooks.h>
 
diff --git a/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/wchar_t/12948-4.cc b/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/wchar_t/12948-4.cc
index 2362251eeaf..7989edc0c3f 100644
--- a/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/wchar_t/12948-4.cc
+++ b/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/wchar_t/12948-4.cc
@@ -17,6 +17,8 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
+// { dg-additional-files "cin_unget-1.txt" }
+
 #include <ext/stdio_sync_filebuf.h>
 #include <testsuite_hooks.h>
 
