* [PATCH 1/8] libstdc++: Clean up @diff@ markup in some I/O tests
@ 2024-07-22 16:28 Jonathan Wakely
2024-07-22 16:28 ` [PATCH 2/8] libstdc++: Replace @require@ " Jonathan Wakely
` (7 more replies)
0 siblings, 8 replies; 12+ messages in thread
From: Jonathan Wakely @ 2024-07-22 16:28 UTC (permalink / raw)
To: libstdc++, gcc-patches
Tested x86_64-linux.
-- >8 --
We have a number of 27_io/* tests with comments like this:
// @require@ %-*.tst
// @diff@ %-*.tst %-*.txt
It seems that these declare required data files used by the test and a
post-test action to compare the test output with the expected result.
We do have tests that depend on some *.tst and/or *.txt files that are
copied from testsuite/data into each test's working directory before it
runs, so the comments are related to those dependencies. However,
nothing in the current test framework actually makes use of these
comments. Currently, every test gets a fresh copy of every *.tst and
*.txt file in the testsuite/data directory, whether the test actually
requires them or not.
This change is the first in a series to clean up this unused markup in
the tests. This first step is to just remove all @require@ and @diff@
comments where they seem to serve no purpose at all. These tests do not
open any of the *.tst or *.txt files that are copied into the test's
working directory from the testsuite/data directory, so they don't
"require" any of those files, and there's no need to "diff" them after
the test runs.
libstdc++-v3/ChangeLog:
* testsuite/27_io/basic_filebuf/close/char/4879.cc: Remove
@require@ and @diff@ comments.
* testsuite/27_io/basic_filebuf/close/char/9964.cc: Likewise.
* testsuite/27_io/basic_filebuf/open/char/3.cc: Likewise.
* testsuite/27_io/basic_filebuf/open/char/9507.cc: Likewise.
* testsuite/27_io/basic_filebuf/sbumpc/char/1-out.cc: Likewise.
* testsuite/27_io/basic_filebuf/sbumpc/char/2-out.cc: Likewise.
* testsuite/27_io/basic_filebuf/sgetc/char/1-out.cc: Likewise.
* testsuite/27_io/basic_filebuf/sgetc/char/2-out.cc: Likewise.
* testsuite/27_io/basic_filebuf/sgetn/char/1-out.cc: Likewise.
* testsuite/27_io/basic_filebuf/sgetn/char/2-out.cc: Likewise.
* testsuite/27_io/basic_filebuf/snextc/char/2-out.cc: Likewise.
* testsuite/27_io/basic_filebuf/sputbackc/char/1-io.cc:
Likewise.
* testsuite/27_io/basic_filebuf/sputbackc/char/1-out.cc:
Likewise.
* testsuite/27_io/basic_filebuf/sputbackc/char/2-io.cc:
Likewise.
* testsuite/27_io/basic_filebuf/sputbackc/char/2-out.cc:
Likewise.
* testsuite/27_io/basic_filebuf/sputc/char/1-out.cc: Likewise.
* testsuite/27_io/basic_filebuf/sputc/char/2-out.cc: Likewise.
* testsuite/27_io/basic_filebuf/sputn/char/1-out.cc: Likewise.
* testsuite/27_io/basic_filebuf/sputn/char/2-out.cc: Likewise.
* testsuite/27_io/basic_filebuf/sungetc/char/1-io.cc: Likewise.
* testsuite/27_io/basic_filebuf/sungetc/char/1-out.cc: Likewise.
* testsuite/27_io/basic_filebuf/sungetc/char/2-io.cc: Likewise.
* testsuite/27_io/basic_filebuf/sungetc/char/2-out.cc: Likewise.
* testsuite/27_io/basic_filebuf/sputc/char/1-io.cc: Likewise.
Remove unused variable.
* testsuite/27_io/basic_filebuf/sputn/char/2-io.cc: Likewise.
* testsuite/27_io/basic_ofstream/cons/char/1.cc: Remove
@require@ and @diff@ comments. Remove unused variables.
* testsuite/27_io/basic_ofstream/rdbuf/char/2832.cc: Remove
* testsuite/27_io/ios_base/sync_with_stdio/2.cc: Likewise.
---
.../testsuite/27_io/basic_filebuf/close/char/4879.cc | 4 +---
.../testsuite/27_io/basic_filebuf/close/char/9964.cc | 4 +---
.../testsuite/27_io/basic_filebuf/open/char/3.cc | 4 +---
.../testsuite/27_io/basic_filebuf/open/char/9507.cc | 4 +---
.../testsuite/27_io/basic_filebuf/sbumpc/char/1-out.cc | 5 +----
.../testsuite/27_io/basic_filebuf/sbumpc/char/2-out.cc | 5 +----
.../testsuite/27_io/basic_filebuf/sgetc/char/1-out.cc | 5 +----
.../testsuite/27_io/basic_filebuf/sgetc/char/2-out.cc | 5 +----
.../testsuite/27_io/basic_filebuf/sgetn/char/1-out.cc | 5 +----
.../testsuite/27_io/basic_filebuf/sgetn/char/2-out.cc | 5 +----
.../testsuite/27_io/basic_filebuf/snextc/char/2-out.cc | 5 +----
.../27_io/basic_filebuf/sputbackc/char/1-io.cc | 5 +----
.../27_io/basic_filebuf/sputbackc/char/1-out.cc | 5 +----
.../27_io/basic_filebuf/sputbackc/char/2-io.cc | 5 +----
.../27_io/basic_filebuf/sputbackc/char/2-out.cc | 5 +----
.../testsuite/27_io/basic_filebuf/sputc/char/1-io.cc | 6 +-----
.../testsuite/27_io/basic_filebuf/sputc/char/1-out.cc | 5 +----
.../testsuite/27_io/basic_filebuf/sputc/char/2-out.cc | 5 +----
.../testsuite/27_io/basic_filebuf/sputn/char/1-out.cc | 5 +----
.../testsuite/27_io/basic_filebuf/sputn/char/2-io.cc | 6 +-----
.../testsuite/27_io/basic_filebuf/sputn/char/2-out.cc | 5 +----
.../testsuite/27_io/basic_filebuf/sungetc/char/1-io.cc | 3 ---
.../27_io/basic_filebuf/sungetc/char/1-out.cc | 3 ---
.../testsuite/27_io/basic_filebuf/sungetc/char/2-io.cc | 3 ---
.../27_io/basic_filebuf/sungetc/char/2-out.cc | 3 ---
.../testsuite/27_io/basic_ofstream/cons/char/1.cc | 4 +---
.../testsuite/27_io/basic_ofstream/rdbuf/char/2832.cc | 10 +---------
.../testsuite/27_io/ios_base/sync_with_stdio/2.cc | 4 +---
28 files changed, 24 insertions(+), 109 deletions(-)
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/4879.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/4879.cc
index 22ccbe70e58..febc8f31a15 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/4879.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/4879.cc
@@ -18,9 +18,7 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// 27.8.1.3 filebuf member functions
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %-*.txt
+// C++98 27.8.1.3 filebuf member functions
// various tests for filebuf::open() and filebuf::close() including
// the non-portable functionality in the libstdc++-v3 IO library
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/9964.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/9964.cc
index d9d73493c2a..796bf5ebdff 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/9964.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/9964.cc
@@ -18,9 +18,7 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// 27.8.1.3 filebuf member functions
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %-*.txt
+// C++98 27.8.1.3 filebuf member functions
// various tests for filebuf::open() and filebuf::close() including
// the non-portable functionality in the libstdc++-v3 IO library
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/3.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/3.cc
index 46ce5032502..abfe2f5731c 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/3.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/3.cc
@@ -15,9 +15,7 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// 27.8.1.3 filebuf member functions
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %-*.txt
+// C++98 27.8.1.3 filebuf member functions
// various tests for filebuf::open() and filebuf::close() including
// the non-portable functionality in the libstdc++-v3 IO library
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/9507.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/9507.cc
index 79ab5d6d756..4af5ed3a90d 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/9507.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/9507.cc
@@ -17,9 +17,7 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// 27.8.1.3 filebuf member functions
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %-*.txt
+// C++98 27.8.1.3 filebuf member functions
// various tests for filebuf::open() and filebuf::close() including
// the non-portable functionality in the libstdc++-v3 IO library
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/1-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/1-out.cc
index 378f7dc275d..a955ae2d494 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/1-out.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/1-out.cc
@@ -17,15 +17,12 @@
// 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
#include <fstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
const char name_02[] = "tmp_sbumpc_1out.tst"; // empty file, need to create
void test05()
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/2-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/2-out.cc
index df1df2b9f88..e78c37cb3ab 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/2-out.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/2-out.cc
@@ -17,15 +17,12 @@
// 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
#include <fstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
const char name_02[] = "tmp_sbumpc_2out.tst"; // empty file, need to create
void test05()
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/1-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/1-out.cc
index b941e4fd619..2d4355185d9 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/1-out.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/1-out.cc
@@ -17,7 +17,7 @@
// 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-require-fileio "" }
@@ -25,9 +25,6 @@
#include <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
const char name_02[] = "tmp_sgetc_1out.tst"; // empty file, need to create
// Test overloaded virtual functions.
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/2-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/2-out.cc
index 29d79e52c63..bf2082e4cc7 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/2-out.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/2-out.cc
@@ -17,15 +17,12 @@
// 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
#include <fstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
const char name_02[] = "tmp_sgetc_2out.tst"; // empty file, need to create
// Test overloaded virtual functions.
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-out.cc
index e5052b208b8..5377e69b6ca 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-out.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-out.cc
@@ -17,15 +17,12 @@
// 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
#include <fstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
const char name_02[] = "tmp_sgetn_1out.tst"; // empty file, need to create
// Test overloaded virtual functions.
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/2-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/2-out.cc
index 158b3c4f5c1..267310e836d 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/2-out.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/2-out.cc
@@ -17,15 +17,12 @@
// 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
#include <fstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
const char name_02[] = "tmp_sgetn_2out.tst"; // empty file, need to create
// Test overloaded virtual functions.
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/2-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/2-out.cc
index fac0654a86f..5003c848c42 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/2-out.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/2-out.cc
@@ -17,15 +17,12 @@
// 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
#include <fstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
const char name_02[] = "tmp_snextc_2out.tst"; // empty file, need to create
void test05()
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/1-io.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/1-io.cc
index 8c467fb404b..59b8970d470 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/1-io.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/1-io.cc
@@ -17,7 +17,7 @@
// 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-require-fileio "" }
@@ -25,9 +25,6 @@
#include <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
const char name_01[] = "tmp_sputbackc_1io.tst"; // empty file, need to create
void test01()
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/1-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/1-out.cc
index cd6c7aec457..01d1c59f8e7 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/1-out.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/1-out.cc
@@ -17,7 +17,7 @@
// 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-require-fileio "" }
@@ -25,9 +25,6 @@
#include <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
const char name_01[] = "tmp_sputbackc_1out.tst"; // empty file, need to create
// Test overloaded virtual functions.
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/2-io.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/2-io.cc
index c33009fdd1f..b2d86b6c54c 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/2-io.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/2-io.cc
@@ -17,7 +17,7 @@
// 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-require-fileio "" }
@@ -25,9 +25,6 @@
#include <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
const char name_01[] = "tmp_sputbackc_2io.tst"; // empty file, need to create
void test01()
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/2-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/2-out.cc
index f56c0620a39..102bcf86e66 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/2-out.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/2-out.cc
@@ -17,7 +17,7 @@
// 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-require-fileio "" }
@@ -25,9 +25,6 @@
#include <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
const char name_01[] = "tmp_sputbackc_2out.tst"; // empty file, need to create
// Test overloaded virtual functions.
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1-io.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1-io.cc
index 9bb32e237fd..25a82090c98 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1-io.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1-io.cc
@@ -17,7 +17,7 @@
// 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-require-fileio "" }
@@ -25,10 +25,6 @@
#include <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
-const char name_01[] = "filebuf_virtuals-1.txt"; // file with data in it
const char name_03[] = "tmp_sputc_1io.tst";
void test05()
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1-out.cc
index 0bed58c0235..28ad3ce1b13 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1-out.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1-out.cc
@@ -17,7 +17,7 @@
// 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-require-fileio "" }
@@ -25,9 +25,6 @@
#include <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
const char name_02[] = "tmp_sputc_1out.tst"; // empty file, need to create
void test05()
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/2-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/2-out.cc
index dfe71b4a309..762ab6f62d5 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/2-out.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/2-out.cc
@@ -17,7 +17,7 @@
// 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-require-fileio "" }
@@ -25,9 +25,6 @@
#include <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
const char name_02[] = "tmp_sputc_2out.tst"; // empty file, need to create
void test05()
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/1-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/1-out.cc
index f3a203ee2ab..4bf37438b8d 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/1-out.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/1-out.cc
@@ -17,7 +17,7 @@
// 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-require-fileio "" }
@@ -25,9 +25,6 @@
#include <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
const char name_02[] = "tmp_sputn_1out.tst"; // empty file, need to create
void test05()
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/2-io.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/2-io.cc
index fb5a0dc6002..3f711ad5c56 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/2-io.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/2-io.cc
@@ -17,7 +17,7 @@
// 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-require-fileio "" }
@@ -25,10 +25,6 @@
#include <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
-const char name_01[] = "filebuf_virtuals-1.txt"; // file with data in it
const char name_03[] = "tmp_sputn_2io.tst"; // empty file, need to create
void test05()
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/2-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/2-out.cc
index 5fc75543ab9..d1c252511f4 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/2-out.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/2-out.cc
@@ -17,7 +17,7 @@
// 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-require-fileio "" }
@@ -25,9 +25,6 @@
#include <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
const char name_02[] = "tmp_sputn_2out.tst"; // empty file, need to create
void test05()
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/1-io.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/1-io.cc
index b4ff4045886..cf28372d2d5 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/1-io.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/1-io.cc
@@ -25,9 +25,6 @@
#include <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
const char name_01[] = "tmp_sungetc_1io.tst"; // empty file, need to create
void test01()
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/1-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/1-out.cc
index 52c33f60eca..2a48362b1be 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/1-out.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/1-out.cc
@@ -23,9 +23,6 @@
#include <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
const char name_01[] = "tmp_sungetc_1out.tst"; // empty file, need to create
// Test overloaded virtual functions.
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/2-io.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/2-io.cc
index 0791f42d847..11239553476 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/2-io.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/2-io.cc
@@ -25,9 +25,6 @@
#include <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
const char name_01[] = "tmp_sungetc_2io.tst"; // empty file, need to create
void test01()
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/2-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/2-out.cc
index 76c61a1d8ce..d131fd8862e 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/2-out.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/2-out.cc
@@ -23,9 +23,6 @@
#include <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
const char name_01[] = "tmp_sungetc_2out.tst"; // empty file, need to create
// Test overloaded virtual functions.
diff --git a/libstdc++-v3/testsuite/27_io/basic_ofstream/cons/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_ofstream/cons/char/1.cc
index 2c5c3d8525e..79f56b72dc7 100644
--- a/libstdc++-v3/testsuite/27_io/basic_ofstream/cons/char/1.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_ofstream/cons/char/1.cc
@@ -15,9 +15,7 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// 27.8.1.10 ofstream member functions
-// @require@ %-*.tst
-// @diff@ %-*.tst %-*.txt
+// C++98 27.8.1.10 ofstream member functions
// { dg-require-fileio "" }
diff --git a/libstdc++-v3/testsuite/27_io/basic_ofstream/rdbuf/char/2832.cc b/libstdc++-v3/testsuite/27_io/basic_ofstream/rdbuf/char/2832.cc
index 0b1594bf2a7..15575f7c710 100644
--- a/libstdc++-v3/testsuite/27_io/basic_ofstream/rdbuf/char/2832.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_ofstream/rdbuf/char/2832.cc
@@ -15,16 +15,12 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// 27.8.1.10 ofstream member functions
-// @require@ %-*.tst
-// @diff@ %-*.tst %-*.txt
+// C++98 27.8.1.10 ofstream member functions
#include <ostream>
#include <fstream>
#include <testsuite_hooks.h>
-const char name_01[] = "ofstream_members-1.tst";
-
void
redirect_buffer(std::ios& stream, std::streambuf* new_buf)
{ stream.rdbuf(new_buf); }
@@ -36,10 +32,6 @@ active_buffer(std::ios& stream)
// libstdc++/2832
void test03()
{
- const char* strlit01 = "fuck war";
- const std::string str00;
- const std::string str01(strlit01);
- std::string str02;
std::filebuf fbuf;
std::streambuf* pbasebuf0 = &fbuf;
diff --git a/libstdc++-v3/testsuite/27_io/ios_base/sync_with_stdio/2.cc b/libstdc++-v3/testsuite/27_io/ios_base/sync_with_stdio/2.cc
index 043bafbd32f..65908feffbd 100644
--- a/libstdc++-v3/testsuite/27_io/ios_base/sync_with_stdio/2.cc
+++ b/libstdc++-v3/testsuite/27_io/ios_base/sync_with_stdio/2.cc
@@ -19,9 +19,7 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// 27.4.2.4 ios_base static members
-// @require@ %-*.tst
-// @diff@ %-*.tst %-*.txt
+// C++98 27.4.2.4 ios_base static members
#include <cstdio>
#include <sstream>
--
2.45.2
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 2/8] libstdc++: Replace @require@ markup in some I/O tests
2024-07-22 16:28 [PATCH 1/8] libstdc++: Clean up @diff@ markup in some I/O tests Jonathan Wakely
@ 2024-07-22 16:28 ` Jonathan Wakely
2024-07-22 16:28 ` [PATCH 3/8] libstdc++: Use dg-additional-files " Jonathan Wakely
` (6 subsequent siblings)
7 siblings, 0 replies; 12+ messages in thread
From: Jonathan Wakely @ 2024-07-22 16:28 UTC (permalink / raw)
To: libstdc++, gcc-patches
Tested x86_64-linux.
-- >8 --
We can replace the @require@ markup with { dg-additional-files ... }
directives, so that the required files are explicitly named and are
explicitly copied into place for tests that require it. This will allow
a later change to remove the "Copy all required data files" step in the
proc libstdc++_init in testsuite/lib/libstdc++.exp that is marked TODO.
This commit uses dg-additional-files for a subset of the files that
contain @require@.
Also remove the @diff@ markup where appears to be copy & pasted from
other test files, and so serves no purpose. For example, there is no
output file created by 27_io/basic_ifstream/cons/char/1.cc so there is
nothing for @diff@ to compare. Maybe the purpose was to check that
reading the .tst file with an ifstream doesn't change it, but we've
survived without doing those comparisons for many years so I think we
can remove those cases of @diff@ markup.
libstdc++-v3/ChangeLog:
* testsuite/27_io/basic_filebuf/close/char/2.cc: Remove
@require@ and @diff@ markup. Use dg-additional-files. Remove
unused variable.
* testsuite/27_io/basic_filebuf/close/char/3.cc: Remove
@require@ and @diff@ markup. Use dg-additional-files.
* testsuite/27_io/basic_filebuf/close/char/4.cc: Likewise.
* testsuite/27_io/basic_filebuf/close/char/5.cc: Likewise.
* testsuite/27_io/basic_filebuf/in_avail/char/1.cc: Likewise.
* testsuite/27_io/basic_filebuf/is_open/char/1.cc: Likewise.
* testsuite/27_io/basic_filebuf/open/char/1.cc: Likewise.
* testsuite/27_io/basic_filebuf/open/char/2.cc: Likewise.
* testsuite/27_io/basic_filebuf/sbumpc/char/1-in.cc: Likewise.
* testsuite/27_io/basic_filebuf/sbumpc/char/1-io.cc: Likewise.
* testsuite/27_io/basic_filebuf/sbumpc/char/2-in.cc: Likewise.
* testsuite/27_io/basic_filebuf/sbumpc/char/2-io.cc: Likewise.
* testsuite/27_io/basic_filebuf/seekoff/char/1-in.cc: Likewise.
* testsuite/27_io/basic_filebuf/seekoff/char/1-out.cc: Likewise.
* testsuite/27_io/basic_filebuf/seekoff/char/2-in.cc: Likewise.
* testsuite/27_io/basic_filebuf/seekoff/char/2-out.cc: Likewise.
* testsuite/27_io/basic_filebuf/seekpos/char/1-in.cc: Likewise.
* testsuite/27_io/basic_filebuf/seekpos/char/1-out.cc: Likewise.
* testsuite/27_io/basic_filebuf/seekpos/char/2-in.cc: Likewise.
* testsuite/27_io/basic_filebuf/seekpos/char/2-out.cc: Likewise.
* testsuite/27_io/basic_filebuf/sgetc/char/1-in.cc: Likewise.
* testsuite/27_io/basic_filebuf/sgetc/char/1-io.cc: Likewise.
* testsuite/27_io/basic_filebuf/sgetc/char/2-in.cc: Likewise.
* testsuite/27_io/basic_filebuf/sgetc/char/2-io.cc: Likewise.
* testsuite/27_io/basic_filebuf/sgetn/char/1-in.cc: Likewise.
* testsuite/27_io/basic_filebuf/sgetn/char/1-io.cc: Likewise.
* testsuite/27_io/basic_filebuf/sgetn/char/2-in.cc: Likewise.
* testsuite/27_io/basic_filebuf/sgetn/char/2-io.cc: Likewise.
* testsuite/27_io/basic_filebuf/snextc/char/1-in.cc: Likewise.
* testsuite/27_io/basic_filebuf/snextc/char/1-io.cc: Likewise.
* testsuite/27_io/basic_filebuf/snextc/char/1-out.cc: Likewise.
* testsuite/27_io/basic_filebuf/snextc/char/2-in.cc: Likewise.
* testsuite/27_io/basic_filebuf/snextc/char/2-io.cc: Likewise.
* testsuite/27_io/basic_filebuf/sputbackc/char/1-in.cc:
Likewise.
* testsuite/27_io/basic_filebuf/sputbackc/char/2-in.cc:
Likewise.
* testsuite/27_io/basic_filebuf/sputc/char/1-in.cc: Likewise.
* testsuite/27_io/basic_filebuf/sputc/char/2-in.cc: Likewise.
* testsuite/27_io/basic_filebuf/sputc/char/2-io.cc: Likewise.
* testsuite/27_io/basic_filebuf/sputn/char/1-in.cc: Likewise.
* testsuite/27_io/basic_filebuf/sputn/char/1-io.cc: Likewise.
Remove unused variable.
* testsuite/27_io/basic_filebuf/sputn/char/2-in.cc: Remove
@require@ and @diff@ markup. Use dg-additional-files.
* testsuite/27_io/basic_filebuf/sungetc/char/1-in.cc: Likewise.
* testsuite/27_io/basic_filebuf/sungetc/char/2-in.cc: Likewise.
* testsuite/27_io/basic_ifstream/cons/char/1.cc: Likewise.
* testsuite/27_io/basic_ifstream/open/char/1.cc: Likewise.
* testsuite/27_io/basic_ifstream/rdbuf/char/2832.cc: Likewise.
* testsuite/27_io/basic_istream/readsome/char/6746-2.cc:
Likewise.
* testsuite/27_io/basic_istream/readsome/wchar_t/6746-2.cc:
Likewise.
* testsuite/27_io/basic_istream/seekg/char/sstream.cc: Likewise.
* testsuite/27_io/basic_istream/seekg/wchar_t/sstream.cc:
Likewise.
* testsuite/27_io/basic_istream/tellg/char/1.cc: Likewise.
* testsuite/27_io/basic_istream/tellg/char/sstream.cc: Likewise.
* testsuite/27_io/basic_istream/tellg/wchar_t/1.cc: Likewise.
* testsuite/27_io/basic_istream/tellg/wchar_t/sstream.cc:
Likewise.
* testsuite/27_io/basic_ofstream/open/char/1.cc: Likewise.
* testsuite/lib/dg-options.exp (dg-additional-files): Append to
v3_additional_files instead of replacing.
* testsuite/lib/libstdc++.exp (v3_target_compile): Reset
v3_additional_files after copying files.
---
.../testsuite/27_io/basic_filebuf/close/char/2.cc | 6 ++----
.../testsuite/27_io/basic_filebuf/close/char/3.cc | 5 ++---
.../testsuite/27_io/basic_filebuf/close/char/4.cc | 5 ++---
.../testsuite/27_io/basic_filebuf/close/char/5.cc | 8 ++++----
.../testsuite/27_io/basic_filebuf/in_avail/char/1.cc | 6 ++----
.../testsuite/27_io/basic_filebuf/is_open/char/1.cc | 5 ++---
.../testsuite/27_io/basic_filebuf/open/char/1.cc | 5 ++---
.../testsuite/27_io/basic_filebuf/open/char/2.cc | 5 ++---
.../testsuite/27_io/basic_filebuf/sbumpc/char/1-in.cc | 6 ++----
.../testsuite/27_io/basic_filebuf/sbumpc/char/1-io.cc | 6 ++----
.../testsuite/27_io/basic_filebuf/sbumpc/char/2-in.cc | 6 ++----
.../testsuite/27_io/basic_filebuf/sbumpc/char/2-io.cc | 6 ++----
.../27_io/basic_filebuf/seekoff/char/1-in.cc | 6 ++----
.../27_io/basic_filebuf/seekoff/char/1-out.cc | 6 ++----
.../27_io/basic_filebuf/seekoff/char/2-in.cc | 6 ++----
.../27_io/basic_filebuf/seekoff/char/2-out.cc | 6 ++----
.../27_io/basic_filebuf/seekpos/char/1-in.cc | 6 ++----
.../27_io/basic_filebuf/seekpos/char/1-out.cc | 6 ++----
.../27_io/basic_filebuf/seekpos/char/2-in.cc | 6 ++----
.../27_io/basic_filebuf/seekpos/char/2-out.cc | 6 ++----
.../testsuite/27_io/basic_filebuf/sgetc/char/1-in.cc | 6 ++----
.../testsuite/27_io/basic_filebuf/sgetc/char/1-io.cc | 6 ++----
.../testsuite/27_io/basic_filebuf/sgetc/char/2-in.cc | 6 ++----
.../testsuite/27_io/basic_filebuf/sgetc/char/2-io.cc | 6 ++----
.../testsuite/27_io/basic_filebuf/sgetn/char/1-in.cc | 6 ++----
.../testsuite/27_io/basic_filebuf/sgetn/char/1-io.cc | 6 ++----
.../testsuite/27_io/basic_filebuf/sgetn/char/2-in.cc | 6 ++----
.../testsuite/27_io/basic_filebuf/sgetn/char/2-io.cc | 6 ++----
.../testsuite/27_io/basic_filebuf/snextc/char/1-in.cc | 6 ++----
.../testsuite/27_io/basic_filebuf/snextc/char/1-io.cc | 6 ++----
.../27_io/basic_filebuf/snextc/char/1-out.cc | 7 +++----
.../testsuite/27_io/basic_filebuf/snextc/char/2-in.cc | 6 ++----
.../testsuite/27_io/basic_filebuf/snextc/char/2-io.cc | 6 ++----
.../27_io/basic_filebuf/sputbackc/char/1-in.cc | 6 ++----
.../27_io/basic_filebuf/sputbackc/char/2-in.cc | 6 ++----
.../testsuite/27_io/basic_filebuf/sputc/char/1-in.cc | 7 +++----
.../testsuite/27_io/basic_filebuf/sputc/char/2-in.cc | 7 +++----
.../testsuite/27_io/basic_filebuf/sputc/char/2-io.cc | 6 ++----
.../testsuite/27_io/basic_filebuf/sputn/char/1-in.cc | 7 +++----
.../testsuite/27_io/basic_filebuf/sputn/char/1-io.cc | 7 ++-----
.../testsuite/27_io/basic_filebuf/sputn/char/2-in.cc | 7 +++----
.../27_io/basic_filebuf/sungetc/char/1-in.cc | 3 +--
.../27_io/basic_filebuf/sungetc/char/2-in.cc | 4 +---
.../testsuite/27_io/basic_ifstream/cons/char/1.cc | 5 ++---
.../testsuite/27_io/basic_ifstream/open/char/1.cc | 5 ++---
.../testsuite/27_io/basic_ifstream/rdbuf/char/2832.cc | 11 +----------
.../27_io/basic_istream/readsome/char/6746-2.cc | 5 ++---
.../27_io/basic_istream/readsome/wchar_t/6746-2.cc | 5 ++---
.../27_io/basic_istream/seekg/char/sstream.cc | 5 ++---
.../27_io/basic_istream/seekg/wchar_t/sstream.cc | 5 ++---
.../testsuite/27_io/basic_istream/tellg/char/1.cc | 5 ++---
.../27_io/basic_istream/tellg/char/sstream.cc | 5 ++---
.../testsuite/27_io/basic_istream/tellg/wchar_t/1.cc | 5 ++---
.../27_io/basic_istream/tellg/wchar_t/sstream.cc | 5 ++---
.../testsuite/27_io/basic_ofstream/open/char/1.cc | 5 +++--
libstdc++-v3/testsuite/lib/dg-options.exp | 2 +-
libstdc++-v3/testsuite/lib/libstdc++.exp | 1 +
57 files changed, 117 insertions(+), 208 deletions(-)
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/2.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/2.cc
index c7f655d0bb7..fd71faed734 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/2.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/2.cc
@@ -16,10 +16,9 @@
// <http://www.gnu.org/licenses/>.
// { dg-require-fileio "" }
+// { dg-additional-files "filebuf_virtuals-1.txt" }
-// 27.8.1.3 filebuf member functions
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %-*.txt
+// C++98 27.8.1.3 filebuf member functions
// various tests for filebuf::open() and filebuf::close() including
// the non-portable functionality in the libstdc++-v3 IO library
@@ -39,7 +38,6 @@
// this bug/situation.
const char name_01[] = "filebuf_virtuals-1.txt"; // file with data in it
-const char name_02[] = "filebuf_virtuals-2.txt"; // empty file, need to create
void test_02()
{
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/3.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/3.cc
index ff0b9a5fb7e..cd7550f5677 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/3.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/3.cc
@@ -17,13 +17,12 @@
// 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.3 filebuf member functions
#include <fstream>
#include <testsuite_hooks.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
+// { dg-additional-files "filebuf_virtuals-1.txt" }
// NB: This test assumes that _M_buf_size == 40, and not the usual
// buffer_size length of BUFSIZ (8192), so that overflow/underflow can be
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/4.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/4.cc
index 0e0949d79e9..931da865247 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/4.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/4.cc
@@ -18,10 +18,9 @@
// <http://www.gnu.org/licenses/>.
// { dg-require-fileio "" }
+// { dg-additional-files "filebuf_virtuals-1.txt" }
-// 27.8.1.3 filebuf member functions
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %-*.txt
+// C++98 27.8.1.3 filebuf member functions
// Test that upon filebuf::close() 27.8.1.1,3 is enforced.
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/5.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/5.cc
index 6402c77b44a..29804fb5014 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/5.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/5.cc
@@ -17,11 +17,11 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// 27.8.1.3 filebuf member functions
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %-*.txt
+// C++98 27.8.1.3 filebuf member functions
-// Test that upon filebuf::close() 27.8.1.1,3 is enforced.
+// { dg-additional-files "filebuf_virtuals-1.txt" }
+
+// Test that upon filebuf::close() 27.8.1.1 p3 is enforced.
#include <fstream>
#include <testsuite_hooks.h>
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/in_avail/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/in_avail/char/1.cc
index 505293021ea..40b15317d69 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/in_avail/char/1.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/in_avail/char/1.cc
@@ -17,16 +17,14 @@
// 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-require-fileio "" }
+// { dg-additional-files "filebuf_virtuals-1.txt" }
#include <fstream>
#include <testsuite_hooks.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
// NB: This test assumes that _M_buf_size == 40, and not the usual
// buffer_size length of BUFSIZ (8192), so that overflow/underflow can be
// simulated a bit more readily.
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/is_open/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/is_open/char/1.cc
index 54fb0094567..d8e23e534f6 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/is_open/char/1.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/is_open/char/1.cc
@@ -15,14 +15,13 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// 27.8.1.3 filebuf member functions
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %-*.txt
+// C++98 27.8.1.3 filebuf member functions
// various tests for filebuf::open() and filebuf::close() including
// the non-portable functionality in the libstdc++-v3 IO library
// { dg-require-fileio "" }
+// { dg-additional-files "filebuf_members-1.tst filebuf_members-1.txt" }
#include <fstream>
#include <testsuite_hooks.h>
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/1.cc
index 7a5321bd80c..4ca94cf4879 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/1.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/1.cc
@@ -15,14 +15,13 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// 27.8.1.3 filebuf member functions
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %-*.txt
+// C++98 27.8.1.3 filebuf member functions
// various tests for filebuf::open() and filebuf::close() including
// the non-portable functionality in the libstdc++-v3 IO library
// { dg-require-fileio "" }
+// { dg-additional-files "filebuf_members-1.tst filebuf_members-1.txt" }
#include <fstream>
#include <testsuite_hooks.h>
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/2.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/2.cc
index 5801b2ad379..cdd06d38c35 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/2.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/2.cc
@@ -15,14 +15,13 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// 27.8.1.3 filebuf member functions
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %-*.txt
+// C++98 27.8.1.3 filebuf member functions
// various tests for filebuf::open() and filebuf::close() including
// the non-portable functionality in the libstdc++-v3 IO library
// { dg-require-fileio "" }
+// { dg-additional-files "filebuf_virtuals-1.txt" }
#include <fstream>
#include <unistd.h>
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/1-in.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/1-in.cc
index 0f419c1df6d..b3733cc6916 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/1-in.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/1-in.cc
@@ -17,17 +17,15 @@
// 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-require-fileio "" }
+// { dg-additional-files "sgetc.txt" }
#include <fstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
const char name_01[] = "sgetc.txt"; // file with data in it
void test05()
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/1-io.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/1-io.cc
index eceae02f5b3..439f8de29c6 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/1-io.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/1-io.cc
@@ -17,17 +17,15 @@
// 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-require-fileio "" }
+// { dg-additional-files "sgetc.txt" }
#include <fstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
const char name_01[] = "sgetc.txt"; // file with data in it
const char name_03[] = "tmp_sbumpc_1io.tst"; // empty file, need to create
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/2-in.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/2-in.cc
index 8c4230c7091..d5b60e488b0 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/2-in.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/2-in.cc
@@ -17,17 +17,15 @@
// 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-require-fileio "" }
+// { dg-additional-files "sgetc.txt" }
#include <fstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
const char name_01[] = "sgetc.txt"; // file with data in it
void test05()
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/2-io.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/2-io.cc
index b8a152ad82a..b265cd55db4 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/2-io.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/2-io.cc
@@ -17,17 +17,15 @@
// 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-require-fileio "" }
+// { dg-additional-files "sgetc.txt" }
#include <fstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
const char name_01[] = "sgetc.txt"; // file with data in it
const char name_03[] = "tmp_sbumpc_2io.tst"; // empty file, need to create
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/1-in.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/1-in.cc
index c8584c2f18b..47d1b897963 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/1-in.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/1-in.cc
@@ -17,17 +17,15 @@
// 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-require-fileio "" }
+// { dg-additional-files "seekoff.txt" }
#include <fstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
const char name_01[] = "seekoff.txt";
void test05()
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/1-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/1-out.cc
index f78612cae88..7220b22c24c 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/1-out.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/1-out.cc
@@ -17,17 +17,15 @@
// 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-require-fileio "" }
+// { dg-additional-files "seekoff-1out.tst" }
#include <fstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
const char name_01[] = "seekoff-1out.tst";
void test05()
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/2-in.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/2-in.cc
index 7c3784f84dd..d69f2907773 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/2-in.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/2-in.cc
@@ -17,17 +17,15 @@
// 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-require-fileio "" }
+// { dg-additional-files "seekoff.txt" }
#include <fstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
const char name_01[] = "seekoff.txt";
void test05()
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/2-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/2-out.cc
index c4b0d4b72bc..e07b2097916 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/2-out.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/2-out.cc
@@ -17,17 +17,15 @@
// 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-require-fileio "" }
+// { dg-additional-files "seekoff-2out.tst" }
#include <fstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
const char name_01[] = "seekoff-2out.tst";
void test05()
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/1-in.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/1-in.cc
index 88c6c7eee87..4e7d98716c1 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/1-in.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/1-in.cc
@@ -17,17 +17,15 @@
// 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-require-fileio "" }
+// { dg-additional-files "seekpos.txt" }
#include <fstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
const char name_01[] = "seekpos.txt"; // file with data in it
void test05()
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/1-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/1-out.cc
index a6cfbfc3e6e..7c0486ef8ca 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/1-out.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/1-out.cc
@@ -17,17 +17,15 @@
// 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-require-fileio "" }
+// { dg-additional-files "seekpos-1out.tst" }
#include <fstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
const char name_01[] = "seekpos-1out.tst"; // file with data in it
void test05()
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/2-in.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/2-in.cc
index 05eed15af24..3f80ec92079 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/2-in.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/2-in.cc
@@ -17,17 +17,15 @@
// 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-require-fileio "" }
+// { dg-additional-files "seekpos.txt" }
#include <fstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
const char name_01[] = "seekpos.txt"; // file with data in it
void test05()
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/2-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/2-out.cc
index c1d7bf754ce..d0b34c23a4c 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/2-out.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/2-out.cc
@@ -17,17 +17,15 @@
// 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-require-fileio "" }
+// { dg-additional-files "seekpos-2out.tst" }
#include <fstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
const char name_01[] = "seekpos-2out.tst"; // file with data in it
void test05()
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/1-in.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/1-in.cc
index 1e6dfd2bda3..27b8c5cc2e4 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/1-in.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/1-in.cc
@@ -17,17 +17,15 @@
// 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-require-fileio "" }
+// { dg-additional-files "filebuf_virtuals-1.txt" }
#include <fstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
const char name_01[] = "filebuf_virtuals-1.txt"; // file with data in it
// Test overloaded virtual functions.
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/1-io.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/1-io.cc
index 8f1f36c15cb..f9d68f6be0a 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/1-io.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/1-io.cc
@@ -17,17 +17,15 @@
// 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-require-fileio "" }
+// { dg-additional-files "sgetc.txt" }
#include <fstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
const char name_01[] = "sgetc.txt"; // file with data in it
const char name_03[] = "tmp_sgetc_1io.tst"; // empty file, need to create
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/2-in.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/2-in.cc
index aca1593d5b5..955af5b6848 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/2-in.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/2-in.cc
@@ -17,17 +17,15 @@
// 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-require-fileio "" }
+// { dg-additional-files "sgetc.txt" }
#include <fstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
const char name_01[] = "sgetc.txt"; // file with data in it
// Test overloaded virtual functions.
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/2-io.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/2-io.cc
index b233df872d0..4fea4585ba7 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/2-io.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/2-io.cc
@@ -17,17 +17,15 @@
// 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-require-fileio "" }
+// { dg-additional-files "sgetc.txt" }
#include <fstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
const char name_01[] = "sgetc.txt"; // file with data in it
const char name_03[] = "tmp_sgetc_2io.tst"; // empty file, need to create
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-in.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-in.cc
index 9791706a99f..2af5cb4493c 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-in.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-in.cc
@@ -21,18 +21,16 @@
// causes "in_avail" to return an incorrect value.
// { dg-do run { xfail arm*-*-elf arm*-*-eabi } }
-// 27.8.1.4 Overridden virtual functions
+// C++98 27.8.1.4 Overridden virtual functions
// { dg-require-fileio "" }
// { dg-require-binary-io "" }
+// { dg-additional-files "sgetn.txt" }
#include <fstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
const char name_01[] = "sgetn.txt"; // file with data in it
// Test overloaded virtual functions.
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-io.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-io.cc
index 506d0676bd5..6ad69300323 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-io.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-io.cc
@@ -21,18 +21,16 @@
// causes "in_avail" to return an incorrect value.
// { dg-do run { xfail arm*-*-elf arm*-*-eabi } }
-// 27.8.1.4 Overridden virtual functions
+// C++98 27.8.1.4 Overridden virtual functions
// { dg-require-fileio "" }
// { dg-require-binary-io "" }
+// { dg-additional-files "sgetn.txt" }
#include <fstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
const char name_01[] = "sgetn.txt"; // file with data in it
const char name_03[] = "tmp_sgetn_1io.tst"; // empty file, need to create
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/2-in.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/2-in.cc
index 1b16f5d0b49..57074832062 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/2-in.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/2-in.cc
@@ -21,18 +21,16 @@
// causes "in_avail" to return an incorrect value.
// { dg-do run { xfail arm*-*-elf arm*-*-eabi } }
-// 27.8.1.4 Overridden virtual functions
+// C++98 27.8.1.4 Overridden virtual functions
// { dg-require-fileio "" }
// { dg-require-binary-io "" }
+// { dg-additional-files "sgetn.txt" }
#include <fstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
const char name_01[] = "sgetn.txt"; // file with data in it
// Test overloaded virtual functions.
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/2-io.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/2-io.cc
index c185a4adb1e..c3112f718a8 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/2-io.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/2-io.cc
@@ -21,18 +21,16 @@
// causes "in_avail" to return an incorrect value.
// { dg-do run { xfail arm*-*-elf arm*-*-eabi } }
-// 27.8.1.4 Overridden virtual functions
+// C++98 27.8.1.4 Overridden virtual functions
// { dg-require-fileio "" }
// { dg-require-binary-io "" }
+// { dg-additional-files "sgetn.txt" }
#include <fstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
const char name_01[] = "sgetn.txt"; // file with data in it
const char name_03[] = "tmp_sgetn_2io.tst"; // empty file, need to create
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/1-in.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/1-in.cc
index e79972af7b2..0e5078c5a13 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/1-in.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/1-in.cc
@@ -17,17 +17,15 @@
// 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-require-fileio "" }
+// { dg-additional-files "sgetc.txt" }
#include <fstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
const char name_01[] = "sgetc.txt"; // file with data in it
const char name_02[] = "tmp_snextc_1out.tst"; // empty file, need to create
const char name_03[] = "tmp_snextc_1io.tst"; // empty file, need to create
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/1-io.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/1-io.cc
index a02aef40ccf..974c661c4ab 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/1-io.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/1-io.cc
@@ -17,17 +17,15 @@
// 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-require-fileio "" }
+// { dg-additional-files "sgetc.txt" }
#include <fstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
const char name_01[] = "sgetc.txt"; // file with data in it
const char name_02[] = "tmp_snextc_1out.tst"; // empty file, need to create
const char name_03[] = "tmp_snextc_1io.tst"; // empty file, need to create
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/1-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/1-out.cc
index b724f13c73b..a61a77b96c2 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/1-out.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/1-out.cc
@@ -17,15 +17,14 @@
// 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 "sgetc.txt" }
#include <fstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
const char name_01[] = "sgetc.txt"; // file with data in it
const char name_02[] = "tmp_snextc_1out.tst"; // empty file, need to create
const char name_03[] = "tmp_snextc_1io.tst"; // empty file, need to create
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/2-in.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/2-in.cc
index fa681efc83e..b2c754e5de3 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/2-in.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/2-in.cc
@@ -17,17 +17,15 @@
// 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-require-fileio "" }
+// { dg-additional-files "sgetc.txt" }
#include <fstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
const char name_01[] = "sgetc.txt"; // file with data in it
void test05()
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/2-io.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/2-io.cc
index c264412c103..0f62d465d4c 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/2-io.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/2-io.cc
@@ -17,17 +17,15 @@
// 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-require-fileio "" }
+// { dg-additional-files "sgetc.txt" }
#include <fstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
const char name_01[] = "sgetc.txt"; // file with data in it
const char name_03[] = "tmp_snextc_2io.tst"; // empty file, need to create
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/1-in.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/1-in.cc
index c9e54caba81..642ed9e52f5 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/1-in.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/1-in.cc
@@ -17,17 +17,15 @@
// 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-require-fileio "" }
+// { dg-additional-files "sgetc.txt" }
#include <fstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
const char name_01[] = "sgetc.txt"; // file with data in it
// Test overloaded virtual functions.
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/2-in.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/2-in.cc
index 684685dde74..1e4325e79b7 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/2-in.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/2-in.cc
@@ -17,17 +17,15 @@
// 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-require-fileio "" }
+// { dg-additional-files "sgetc.txt" }
#include <fstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
const char name_01[] = "sgetc.txt"; // file with data in it
// Test overloaded virtual functions.
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1-in.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1-in.cc
index bbd25a5e85e..e76064dd592 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1-in.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1-in.cc
@@ -17,15 +17,14 @@
// 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 <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
const char name_01[] = "filebuf_virtuals-1.txt"; // file with data in it
void test05()
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/2-in.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/2-in.cc
index 7505076f97c..c0d423bf063 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/2-in.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/2-in.cc
@@ -17,15 +17,14 @@
// 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 <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
const char name_01[] = "filebuf_virtuals-1.txt"; // file with data in it
void test05()
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/2-io.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/2-io.cc
index 3125d52b42c..f182064ca19 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/2-io.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/2-io.cc
@@ -17,17 +17,15 @@
// 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-require-fileio "" }
+// { dg-additional-files "filebuf_virtuals-1.txt" }
#include <fstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
const char name_01[] = "filebuf_virtuals-1.txt"; // file with data in it
const char name_03[] = "tmp_sputc_2io.tst";
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/1-in.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/1-in.cc
index dd951b040b4..fb9b181ad6c 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/1-in.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/1-in.cc
@@ -17,15 +17,14 @@
// 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 <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
const char name_01[] = "filebuf_virtuals-1.txt"; // file with data in it
void test05()
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/1-io.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/1-io.cc
index c01aed97664..125cde14fdb 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/1-io.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/1-io.cc
@@ -17,18 +17,15 @@
// 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-require-fileio "" }
+// { dg-additional-files "filebuf_virtuals-1.txt" }
#include <fstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
-const char name_01[] = "filebuf_virtuals-1.txt"; // file with data in it
const char name_03[] = "tmp_sputn_1io.tst"; // empty file, need to create
void test05()
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/2-in.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/2-in.cc
index 6a008646fb3..da96056c2ce 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/2-in.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/2-in.cc
@@ -17,15 +17,14 @@
// 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 <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
const char name_01[] = "filebuf_virtuals-1.txt"; // file with data in it
void test05()
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/1-in.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/1-in.cc
index ff2f0fd742f..12bd7da3282 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/1-in.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/1-in.cc
@@ -25,8 +25,7 @@
#include <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
+// { dg-additional-files "sgetc.txt" }
const char name_01[] = "sgetc.txt"; // file with data in it
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/2-in.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/2-in.cc
index af3ad03ef8a..9f34255b8ad 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/2-in.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/2-in.cc
@@ -20,14 +20,12 @@
// 27.8.1.4 Overridden virtual functions
// { dg-require-fileio "" }
+// { dg-additional-files "sgetc.txt" }
#include <fstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %*.txt
-
const char name_01[] = "sgetc.txt"; // file with data in it
// Test overloaded virtual functions.
diff --git a/libstdc++-v3/testsuite/27_io/basic_ifstream/cons/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_ifstream/cons/char/1.cc
index 2611caf54f9..f2658aed886 100644
--- a/libstdc++-v3/testsuite/27_io/basic_ifstream/cons/char/1.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_ifstream/cons/char/1.cc
@@ -15,11 +15,10 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// 27.8.1.7 ifstream member functions
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %-*.txt
+// C++98 27.8.1.7 ifstream member functions
// { dg-require-fileio "" }
+// { dg-additional-files "ifstream_members-1.tst" }
#include <istream>
#include <fstream>
diff --git a/libstdc++-v3/testsuite/27_io/basic_ifstream/open/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_ifstream/open/char/1.cc
index dcd16eddf60..c22de5305a7 100644
--- a/libstdc++-v3/testsuite/27_io/basic_ifstream/open/char/1.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_ifstream/open/char/1.cc
@@ -15,11 +15,10 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// 27.8.1.7 ifstream member functions
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %-*.txt
+// C++98 27.8.1.7 ifstream member functions
// { dg-require-fileio "" }
+// { dg-additional-files "ifstream_members-1.tst" }
#include <istream>
#include <fstream>
diff --git a/libstdc++-v3/testsuite/27_io/basic_ifstream/rdbuf/char/2832.cc b/libstdc++-v3/testsuite/27_io/basic_ifstream/rdbuf/char/2832.cc
index fac3275da67..3623da66dc2 100644
--- a/libstdc++-v3/testsuite/27_io/basic_ifstream/rdbuf/char/2832.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_ifstream/rdbuf/char/2832.cc
@@ -15,17 +15,12 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// 27.8.1.7 ifstream member functions
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %-*.txt
+// C++98 27.8.1.7 ifstream member functions
#include <istream>
#include <fstream>
#include <testsuite_hooks.h>
-const char name_01[] = "ifstream_members-1.tst";
-const char name_02[] = "ifstream_members-1.txt";
-
void
redirect_buffer(std::ios& stream, std::streambuf* new_buf)
{ stream.rdbuf(new_buf); }
@@ -37,10 +32,6 @@ active_buffer(std::ios& stream)
// libstdc++/2832
void test03()
{
- const char* strlit01 = "fuck war";
- const std::string str00;
- const std::string str01(strlit01);
- std::string str02;
std::filebuf fbuf;
std::streambuf* pbasebuf0 = &fbuf;
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/readsome/char/6746-2.cc b/libstdc++-v3/testsuite/27_io/basic_istream/readsome/char/6746-2.cc
index 09cfc3aad0f..f18f60fa472 100644
--- a/libstdc++-v3/testsuite/27_io/basic_istream/readsome/char/6746-2.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_istream/readsome/char/6746-2.cc
@@ -21,12 +21,11 @@
// causes "in_avail" to return an incorrect value.
// { dg-do run { xfail arm*-*-elf arm*-*-eabi } }
-// 27.6.1.3 unformatted input functions
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %-*.txt
+// C++98 27.6.1.3 unformatted input functions
// { dg-require-fileio "" }
// { dg-require-binary-io "" }
+// { dg-additional-files "istream_unformatted-1.tst" }
#include <istream>
#include <fstream>
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/readsome/wchar_t/6746-2.cc b/libstdc++-v3/testsuite/27_io/basic_istream/readsome/wchar_t/6746-2.cc
index d19cb211f4e..3acd5fe7b1b 100644
--- a/libstdc++-v3/testsuite/27_io/basic_istream/readsome/wchar_t/6746-2.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_istream/readsome/wchar_t/6746-2.cc
@@ -21,10 +21,9 @@
// { dg-require-binary-io "" }
// { dg-require-fileio "" }
+// { dg-additional-files "wistream_unformatted-1.tst" }
-// 27.6.1.3 unformatted input functions
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %-*.txt
+// C++98 27.6.1.3 unformatted input functions
#include <istream>
#include <fstream>
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/seekg/char/sstream.cc b/libstdc++-v3/testsuite/27_io/basic_istream/seekg/char/sstream.cc
index 1f9967405d8..72379664e33 100644
--- a/libstdc++-v3/testsuite/27_io/basic_istream/seekg/char/sstream.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_istream/seekg/char/sstream.cc
@@ -17,12 +17,11 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// 27.6.1.3 unformatted input functions
+// C++98 27.6.1.3 unformatted input functions
// NB: ostream has a particular "seeks" category. Adopt this for istreams too.
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %-*.txt
// { dg-require-fileio "" }
+// { dg-additional-files "istream_seeks-1.tst" }
#include <istream>
#include <sstream>
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/seekg/wchar_t/sstream.cc b/libstdc++-v3/testsuite/27_io/basic_istream/seekg/wchar_t/sstream.cc
index da2e27e72a0..30a8a905b6e 100644
--- a/libstdc++-v3/testsuite/27_io/basic_istream/seekg/wchar_t/sstream.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_istream/seekg/wchar_t/sstream.cc
@@ -17,12 +17,11 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// 27.6.1.3 unformatted input functions
+// C++98 27.6.1.3 unformatted input functions
// NB: ostream has a particular "seeks" category. Adopt this for istreams too.
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %-*.txt
// { dg-require-fileio "" }
+// { dg-additional-files "wistream_seeks-1.tst" }
#include <istream>
#include <sstream>
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/tellg/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_istream/tellg/char/1.cc
index e956ecf4e4a..3ab92f9760e 100644
--- a/libstdc++-v3/testsuite/27_io/basic_istream/tellg/char/1.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_istream/tellg/char/1.cc
@@ -17,12 +17,11 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// 27.6.1.3 unformatted input functions
+// C++98 27.6.1.3 unformatted input functions
// NB: ostream has a particular "seeks" category. Adopt this for istreams too.
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %-*.txt
// { dg-require-fileio "" }
+// { dg-additional-files "istream_seeks-1.tst" }
#include <istream>
#include <sstream>
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/tellg/char/sstream.cc b/libstdc++-v3/testsuite/27_io/basic_istream/tellg/char/sstream.cc
index a45d0b59fb8..6da59d0d1a1 100644
--- a/libstdc++-v3/testsuite/27_io/basic_istream/tellg/char/sstream.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_istream/tellg/char/sstream.cc
@@ -17,12 +17,11 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// 27.6.1.3 unformatted input functions
+// C++98 27.6.1.3 unformatted input functions
// NB: ostream has a particular "seeks" category. Adopt this for istreams too.
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %-*.txt
// { dg-require-fileio "" }
+// { dg-additional-files "istream_seeks-1.tst" }
#include <istream>
#include <sstream>
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/tellg/wchar_t/1.cc b/libstdc++-v3/testsuite/27_io/basic_istream/tellg/wchar_t/1.cc
index e2f076a03d1..20b425cbbe0 100644
--- a/libstdc++-v3/testsuite/27_io/basic_istream/tellg/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_istream/tellg/wchar_t/1.cc
@@ -16,11 +16,10 @@
// <http://www.gnu.org/licenses/>.
// { dg-require-fileio "" }
+// { dg-additional-files "wistream_seeks-1.tst" }
-// 27.6.1.3 unformatted input functions
+// C++98 27.6.1.3 unformatted input functions
// NB: ostream has a particular "seeks" category. Adopt this for istreams too.
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %-*.txt
#include <istream>
#include <sstream>
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/tellg/wchar_t/sstream.cc b/libstdc++-v3/testsuite/27_io/basic_istream/tellg/wchar_t/sstream.cc
index b5d005c5342..9118e683c35 100644
--- a/libstdc++-v3/testsuite/27_io/basic_istream/tellg/wchar_t/sstream.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_istream/tellg/wchar_t/sstream.cc
@@ -15,12 +15,11 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// 27.6.1.3 unformatted input functions
+// C++98 27.6.1.3 unformatted input functions
// NB: ostream has a particular "seeks" category. Adopt this for istreams too.
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %-*.txt
// { dg-require-fileio "" }
+// { dg-additional-files "wistream_seeks-1.tst" }
#include <istream>
#include <sstream>
diff --git a/libstdc++-v3/testsuite/27_io/basic_ofstream/open/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_ofstream/open/char/1.cc
index b24ffe210ce..45227107cbd 100644
--- a/libstdc++-v3/testsuite/27_io/basic_ofstream/open/char/1.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_ofstream/open/char/1.cc
@@ -15,8 +15,9 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// 27.8.1.10 ofstream member functions
-// @require@ %-*.tst
+// C++98 27.8.1.10 ofstream member functions
+
+// { dg-additional-files "ofstream_members-1.tst" }
// @diff@ %-*.tst %-*.txt
// { dg-require-fileio "" }
diff --git a/libstdc++-v3/testsuite/lib/dg-options.exp b/libstdc++-v3/testsuite/lib/dg-options.exp
index 0d77fb029b0..1d3160409f5 100644
--- a/libstdc++-v3/testsuite/lib/dg-options.exp
+++ b/libstdc++-v3/testsuite/lib/dg-options.exp
@@ -405,5 +405,5 @@ set v3_additional_files ""
# Process a { dg-additional-files "filelist" } directive in the test.
proc dg-additional-files { line filelist } {
global v3_additional_files
- set v3_additional_files $filelist
+ append v3_additional_files " " $filelist
}
diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp b/libstdc++-v3/testsuite/lib/libstdc++.exp
index 67a63f5b5f3..8efc6f7f089 100644
--- a/libstdc++-v3/testsuite/lib/libstdc++.exp
+++ b/libstdc++-v3/testsuite/lib/libstdc++.exp
@@ -648,6 +648,7 @@ proc v3_target_compile { source dest type options } {
global srcdir
v3-copy-file "$srcdir/data/$file" $file
}
+ set v3_additional_files {}
set comp_output [target_compile $source $dest $type $options]
if { $type == "executable" && $file_to_delete != "" } {
--
2.45.2
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 3/8] libstdc++: Use dg-additional-files in some I/O tests
2024-07-22 16:28 [PATCH 1/8] libstdc++: Clean up @diff@ markup in some I/O tests Jonathan Wakely
2024-07-22 16:28 ` [PATCH 2/8] libstdc++: Replace @require@ " Jonathan Wakely
@ 2024-07-22 16:28 ` Jonathan Wakely
2024-07-22 16:28 ` [PATCH 4/8] libstdc++: Add file-io-diff to replace @diff@ markup in " Jonathan Wakely
` (5 subsequent siblings)
7 siblings, 0 replies; 12+ messages in thread
From: Jonathan Wakely @ 2024-07-22 16:28 UTC (permalink / raw)
To: libstdc++, gcc-patches
Tested x86_64-linux.
-- >8 --
Use the dg-additional-files directive to declare files that need to be
copied into the test's working directory. This is currently redundant
(as all .tst and .txt files are copied for all tests) but is a step
towards not copying all files.
libstdc++-v3/ChangeLog:
* testsuite/27_io/basic_filebuf/imbue/char/2.cc: Use
dg-additional-files.
* testsuite/27_io/basic_filebuf/imbue/wchar_t/2.cc: Likewise.
* testsuite/27_io/basic_filebuf/open/char/path.cc: Likewise.
* testsuite/27_io/basic_filebuf/pbackfail/char/9761.cc:
Likewise.
* testsuite/27_io/basic_filebuf/seekoff/char/3-in.cc: Likewise.
* testsuite/27_io/basic_filebuf/seekoff/char/3-io.cc: Likewise.
* testsuite/27_io/basic_filebuf/seekpos/char/3-in.cc: Likewise.
* testsuite/27_io/basic_filebuf/seekpos/char/3-io.cc: Likewise.
* testsuite/27_io/basic_filebuf/setbuf/char/1.cc: Likewise.
* testsuite/27_io/basic_filebuf/sgetn/char/3.cc: Likewise.
* testsuite/27_io/basic_filebuf/underflow/10096.cc: Likewise.
* testsuite/27_io/basic_fstream/cons/char/path.cc: Likewise.
* testsuite/27_io/basic_fstream/open/char/path.cc: Likewise.
* testsuite/27_io/basic_ifstream/assign/1.cc: Likewise.
* testsuite/27_io/basic_ifstream/cons/move.cc: Likewise.
* testsuite/27_io/basic_ifstream/cons/char/path.cc: Likewise.
* testsuite/27_io/basic_ifstream/open/char/path.cc: Likewise.
* testsuite/27_io/basic_ifstream/open/wchar_t/1.cc: Likewise.
* testsuite/27_io/objects/char/10.cc: Likewise.
* testsuite/27_io/objects/char/12048-1.cc: Likewise.
* testsuite/27_io/objects/char/12048-2.cc: Likewise.
* testsuite/27_io/objects/char/12048-3.cc: Likewise.
* testsuite/27_io/objects/char/12048-4.cc: Likewise.
* testsuite/27_io/objects/char/12048-5.cc: Likewise.
* testsuite/27_io/objects/wchar_t/12048-1.cc: Likewise.
* testsuite/27_io/objects/wchar_t/12048-2.cc: Likewise.
* testsuite/27_io/objects/wchar_t/12048-3.cc: Likewise.
* testsuite/27_io/objects/wchar_t/12048-4.cc: Likewise.
* testsuite/27_io/objects/wchar_t/12048-5.cc: Likewise.
* testsuite/ext/stdio_sync_filebuf/char/12048-1.cc: Likewise.
* testsuite/ext/stdio_sync_filebuf/char/12048-2.cc: Likewise.
* testsuite/ext/stdio_sync_filebuf/char/12048-3.cc: Likewise.
* testsuite/ext/stdio_sync_filebuf/char/12048-4.cc: Likewise.
* testsuite/ext/stdio_sync_filebuf/wchar_t/12948-1.cc: Likewise.
* testsuite/ext/stdio_sync_filebuf/wchar_t/12948-2.cc: Likewise.
* testsuite/ext/stdio_sync_filebuf/wchar_t/12948-3.cc: Likewise.
* testsuite/ext/stdio_sync_filebuf/wchar_t/12948-4.cc: Likewise.
---
libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/2.cc | 4 +++-
libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/wchar_t/2.cc | 1 +
libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/path.cc | 1 +
.../testsuite/27_io/basic_filebuf/pbackfail/char/9761.cc | 1 +
.../testsuite/27_io/basic_filebuf/seekoff/char/3-in.cc | 3 ++-
.../testsuite/27_io/basic_filebuf/seekoff/char/3-io.cc | 3 ++-
.../testsuite/27_io/basic_filebuf/seekpos/char/3-in.cc | 1 +
.../testsuite/27_io/basic_filebuf/seekpos/char/3-io.cc | 1 +
libstdc++-v3/testsuite/27_io/basic_filebuf/setbuf/char/1.cc | 1 +
libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/3.cc | 1 +
libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/10096.cc | 1 +
libstdc++-v3/testsuite/27_io/basic_fstream/cons/char/path.cc | 1 +
libstdc++-v3/testsuite/27_io/basic_fstream/open/char/path.cc | 1 +
libstdc++-v3/testsuite/27_io/basic_ifstream/assign/1.cc | 3 ++-
libstdc++-v3/testsuite/27_io/basic_ifstream/cons/char/path.cc | 1 +
libstdc++-v3/testsuite/27_io/basic_ifstream/cons/move.cc | 3 ++-
libstdc++-v3/testsuite/27_io/basic_ifstream/open/char/path.cc | 1 +
libstdc++-v3/testsuite/27_io/basic_ifstream/open/wchar_t/1.cc | 3 ++-
libstdc++-v3/testsuite/27_io/objects/char/10.cc | 1 +
libstdc++-v3/testsuite/27_io/objects/char/12048-1.cc | 1 +
libstdc++-v3/testsuite/27_io/objects/char/12048-2.cc | 1 +
libstdc++-v3/testsuite/27_io/objects/char/12048-3.cc | 1 +
libstdc++-v3/testsuite/27_io/objects/char/12048-4.cc | 1 +
libstdc++-v3/testsuite/27_io/objects/char/12048-5.cc | 1 +
libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-1.cc | 1 +
libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-2.cc | 1 +
libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-3.cc | 1 +
libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-4.cc | 1 +
libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-5.cc | 1 +
libstdc++-v3/testsuite/ext/stdio_sync_filebuf/char/12048-1.cc | 1 +
libstdc++-v3/testsuite/ext/stdio_sync_filebuf/char/12048-2.cc | 1 +
libstdc++-v3/testsuite/ext/stdio_sync_filebuf/char/12048-3.cc | 1 +
libstdc++-v3/testsuite/ext/stdio_sync_filebuf/char/12048-4.cc | 1 +
.../testsuite/ext/stdio_sync_filebuf/wchar_t/12948-1.cc | 2 ++
.../testsuite/ext/stdio_sync_filebuf/wchar_t/12948-2.cc | 2 ++
.../testsuite/ext/stdio_sync_filebuf/wchar_t/12948-3.cc | 2 ++
.../testsuite/ext/stdio_sync_filebuf/wchar_t/12948-4.cc | 2 ++
37 files changed, 48 insertions(+), 6 deletions(-)
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>
--
2.45.2
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 4/8] libstdc++: Add file-io-diff to replace @diff@ markup in I/O tests
2024-07-22 16:28 [PATCH 1/8] libstdc++: Clean up @diff@ markup in some I/O tests Jonathan Wakely
2024-07-22 16:28 ` [PATCH 2/8] libstdc++: Replace @require@ " Jonathan Wakely
2024-07-22 16:28 ` [PATCH 3/8] libstdc++: Use dg-additional-files " Jonathan Wakely
@ 2024-07-22 16:28 ` Jonathan Wakely
2024-07-29 16:02 ` Polish libstdc++ 'dg-final' action 'file-io-diff' (was: [PATCH 4/8] libstdc++: Add file-io-diff to replace @diff@ markup in I/O tests) Thomas Schwinge
2024-07-22 16:28 ` [PATCH 5/8] libstdc++: Use dg-additional-files in some algorithm tests Jonathan Wakely
` (4 subsequent siblings)
7 siblings, 1 reply; 12+ messages in thread
From: Jonathan Wakely @ 2024-07-22 16:28 UTC (permalink / raw)
To: libstdc++, gcc-patches
Tested x86_64-linux.
-- >8 --
This adds a new dg-final action to compare two files after a test has
run, so that we can verify that fstream operations produce the expected
results. With this change, all uses of @diff@ that seem potentially
useful have been converted to actually compare the files and FAIL if
they differ.
The file-io-diff action can take two arguments naming the files to be
compared, or for convenience it can take a single string and will
compare STR.tst and STR.txt, as that's how it's commonly used.
Additionally, all remaining uses of @require@ are converted to
dg-additional-files directives, so that the TODO in libstdc++.exp can
be resolved.
libstdc++-v3/ChangeLog:
* testsuite/27_io/basic_filebuf/close/char/1.cc: Remove
@require@ and @diff@. Use dg-final file-io-diff action.
* testsuite/27_io/basic_istream/extractors_other/char/2.cc:
Likewise.
* testsuite/27_io/basic_istream/extractors_other/wchar_t/2.cc:
Likewise.
* testsuite/27_io/basic_istream/get/char/2.cc: Likewise.
* testsuite/27_io/basic_istream/get/wchar_t/2.cc: Likewise.
* testsuite/27_io/basic_istream/ignore/char/3.cc: Likewise.
* testsuite/27_io/basic_istream/ignore/wchar_t/3.cc: Likewise.
* testsuite/27_io/basic_istream/peek/char/6414.cc: Likewise.
* testsuite/27_io/basic_istream/peek/wchar_t/6414.cc: Likewise.
* testsuite/27_io/basic_istream/seekg/char/fstream.cc: Likewise.
* testsuite/27_io/basic_istream/seekg/wchar_t/fstream.cc:
Likewise.
* testsuite/27_io/basic_istream/tellg/char/fstream.cc: Likewise.
* testsuite/27_io/basic_istream/tellg/wchar_t/fstream.cc:
Likewise.
* testsuite/27_io/basic_ofstream/open/char/1.cc: Likewise.
* testsuite/27_io/basic_ostream/inserters_other/char/1.cc:
Likewise.
* testsuite/27_io/basic_ostream/inserters_other/wchar_t/1.cc:
Likewise.
* testsuite/27_io/ios_base/sync_with_stdio/1.cc: Likewise.
* testsuite/27_io/basic_ostream/inserters_other/char/2.cc:
Likewise. Check file positions.
* testsuite/27_io/basic_ostream/inserters_other/wchar_t/2.cc:
Likewise.
* testsuite/lib/libstdc++.exp (file-io-diff): New proc.
---
.../27_io/basic_filebuf/close/char/1.cc | 6 ++--
| 9 ++++--
| 9 ++++--
.../27_io/basic_istream/get/char/2.cc | 8 +++--
.../27_io/basic_istream/get/wchar_t/2.cc | 8 +++--
.../27_io/basic_istream/ignore/char/3.cc | 8 +++--
.../27_io/basic_istream/ignore/wchar_t/3.cc | 8 +++--
.../27_io/basic_istream/peek/char/6414.cc | 9 ++++--
.../27_io/basic_istream/peek/wchar_t/6414.cc | 9 ++++--
.../27_io/basic_istream/seekg/char/fstream.cc | 10 ++++--
.../basic_istream/seekg/wchar_t/fstream.cc | 10 ++++--
.../27_io/basic_istream/tellg/char/fstream.cc | 10 ++++--
.../basic_istream/tellg/wchar_t/fstream.cc | 10 ++++--
.../27_io/basic_ofstream/open/char/1.cc | 5 ++-
.../basic_ostream/inserters_other/char/1.cc | 8 +++--
.../basic_ostream/inserters_other/char/2.cc | 7 ++--
.../inserters_other/wchar_t/1.cc | 8 +++--
.../inserters_other/wchar_t/2.cc | 7 ++--
.../27_io/ios_base/sync_with_stdio/1.cc | 5 +--
libstdc++-v3/testsuite/lib/libstdc++.exp | 32 +++++++++++++++++++
20 files changed, 130 insertions(+), 56 deletions(-)
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/1.cc
index e2b336a711d..d9e9c53e3e6 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/1.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/1.cc
@@ -15,14 +15,14 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// 27.8.1.3 filebuf member functions
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %-*.txt
+// C++98 27.8.1.3 filebuf member functions
// various tests for filebuf::open() and filebuf::close() including
// the non-portable functionality in the libstdc++-v3 IO library
// { dg-require-fileio "" }
+// { dg-additional-files "filebuf_members-1.tst filebuf_members-1.txt" }
+// { dg-final { file-io-diff "filebuf_members-1" } }
#include <fstream>
#include <testsuite_hooks.h>
--git a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/2.cc b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/2.cc
index 589402308c3..77543310caa 100644
--- a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/2.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/2.cc
@@ -17,11 +17,14 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// 27.6.1.2.3 basic_istream::operator>>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %-*.txt
+// C++98 27.6.1.2.3 basic_istream::operator>>
// { dg-require-fileio "" }
+// { dg-additional-files "istream_extractor_other-1.tst" }
+// { dg-additional-files "istream_extractor_other-1.txt" }
+// { dg-additional-files "istream_extractor_other-2.tst" }
+// { dg-final { file-io-diff "istream_extractor_other-1" } }
+// { dg-final { file-io-diff "istream_extractor_other-2" } }
#include <istream>
#include <fstream>
--git a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/wchar_t/2.cc b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/wchar_t/2.cc
index b50dd26513a..82df1a17149 100644
--- a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/wchar_t/2.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/wchar_t/2.cc
@@ -15,11 +15,14 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// 27.6.1.2.3 basic_istream::operator>>
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %-*.txt
+// C++98 27.6.1.2.3 basic_istream::operator>>
// { dg-require-fileio "" }
+// { dg-additional-files "wistream_extractor_other-1.tst" }
+// { dg-additional-files "wistream_extractor_other-1.txt" }
+// { dg-additional-files "wistream_extractor_other-2.tst" }
+// { dg-final { file-io-diff "wistream_extractor_other-1" } }
+// { dg-final { file-io-diff "wistream_extractor_other-2" } }
#include <istream>
#include <fstream>
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/get/char/2.cc b/libstdc++-v3/testsuite/27_io/basic_istream/get/char/2.cc
index cf646f379ef..95bad8badb9 100644
--- a/libstdc++-v3/testsuite/27_io/basic_istream/get/char/2.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_istream/get/char/2.cc
@@ -17,11 +17,13 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// 27.6.1.3 unformatted input functions
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %-*.txt
+// C++98 27.6.1.3 unformatted input functions
// { dg-require-fileio "" }
+// { dg-additional-files "istream_unformatted-1.tst" }
+// { dg-additional-files "istream_unformatted-1.txt" }
+// Reading the .txt file should not alter it:
+// { dg-final { file-io-diff "istream_unformatted-1" } }
#include <istream>
#include <sstream>
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/get/wchar_t/2.cc b/libstdc++-v3/testsuite/27_io/basic_istream/get/wchar_t/2.cc
index 0ea162d8171..c155e402e2c 100644
--- a/libstdc++-v3/testsuite/27_io/basic_istream/get/wchar_t/2.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_istream/get/wchar_t/2.cc
@@ -15,11 +15,13 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// 27.6.1.3 unformatted input functions
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %-*.txt
+// C++98 27.6.1.3 unformatted input functions
// { dg-require-fileio "" }
+// { dg-additional-files "istream_unformatted-1.tst" }
+// { dg-additional-files "istream_unformatted-1.txt" }
+// Reading the .txt file should not alter it:
+// { dg-final { file-io-diff "istream_unformatted-1" } }
#include <istream>
#include <sstream>
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/ignore/char/3.cc b/libstdc++-v3/testsuite/27_io/basic_istream/ignore/char/3.cc
index 222e450e9c8..acfafbcd83b 100644
--- a/libstdc++-v3/testsuite/27_io/basic_istream/ignore/char/3.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_istream/ignore/char/3.cc
@@ -17,11 +17,13 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// 27.6.1.3 unformatted input functions
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %-*.txt
+// C++98 27.6.1.3 unformatted input functions
// { dg-require-fileio "" }
+// { dg-additional-files "istream_unformatted-1.tst" }
+// { dg-additional-files "istream_unformatted-1.txt" }
+// Reading the .txt file should not alter it:
+// { dg-final { file-io-diff "istream_unformatted-1" } }
#include <istream>
#include <fstream>
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/ignore/wchar_t/3.cc b/libstdc++-v3/testsuite/27_io/basic_istream/ignore/wchar_t/3.cc
index c9e942a712c..60c2655b606 100644
--- a/libstdc++-v3/testsuite/27_io/basic_istream/ignore/wchar_t/3.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_istream/ignore/wchar_t/3.cc
@@ -15,11 +15,13 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// 27.6.1.3 unformatted input functions
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %-*.txt
+// C++98 27.6.1.3 unformatted input functions
// { dg-require-fileio "" }
+// { dg-additional-files "istream_unformatted-1.tst" }
+// { dg-additional-files "istream_unformatted-1.txt" }
+// Reading the .txt file should not alter it:
+// { dg-final { file-io-diff "istream_unformatted-1" } }
#include <istream>
#include <fstream>
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/peek/char/6414.cc b/libstdc++-v3/testsuite/27_io/basic_istream/peek/char/6414.cc
index 0e0b44153a8..ffa0e88d8eb 100644
--- a/libstdc++-v3/testsuite/27_io/basic_istream/peek/char/6414.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_istream/peek/char/6414.cc
@@ -17,10 +17,13 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// 27.6.1.3 unformatted input functions
+// C++98 27.6.1.3 unformatted input functions
// NB: ostream has a particular "seeks" category. Adopt this for istreams too.
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %-*.txt
+
+// { dg-additional-files "istream_seeks-1.tst" }
+// { dg-additional-files "istream_seeks-1.txt" }
+// Reading the .txt file should not alter it:
+// { dg-final { file-io-diff "istream_seeks-1" } }
#include <istream>
#include <fstream>
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/peek/wchar_t/6414.cc b/libstdc++-v3/testsuite/27_io/basic_istream/peek/wchar_t/6414.cc
index fbfbfbb2781..0d2172fe85d 100644
--- a/libstdc++-v3/testsuite/27_io/basic_istream/peek/wchar_t/6414.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_istream/peek/wchar_t/6414.cc
@@ -15,10 +15,13 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// 27.6.1.3 unformatted input functions
+// C++98 27.6.1.3 unformatted input functions
// NB: ostream has a particular "seeks" category. Adopt this for istreams too.
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %-*.txt
+
+// { dg-additional-files "wistream_seeks-1.tst" }
+// { dg-additional-files "wistream_seeks-1.txt" }
+// Reading the .txt file should not alter it:
+// { dg-final { file-io-diff "wistream_seeks-1" } }
#include <istream>
#include <fstream>
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/seekg/char/fstream.cc b/libstdc++-v3/testsuite/27_io/basic_istream/seekg/char/fstream.cc
index 0fa91a2716b..52401ca88fd 100644
--- a/libstdc++-v3/testsuite/27_io/basic_istream/seekg/char/fstream.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_istream/seekg/char/fstream.cc
@@ -17,12 +17,16 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// 27.6.1.3 unformatted input functions
+// C++98 27.6.1.3 unformatted input functions
// NB: ostream has a particular "seeks" category. Adopt this for istreams too.
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %-*.txt
// { dg-require-fileio "" }
+// { dg-additional-files "istream_seeks-1.tst" }
+// { dg-additional-files "istream_seeks-1.txt" }
+// { dg-additional-files "istream_seeks-2.tst" }
+// Do not create istream_seeks-2.txt, we want it to be created as empty.
+// { dg-final { file-io-diff "istream_seeks-1" } }
+// { dg-final { file-io-diff "istream_seeks-2" } }
#include <istream>
#include <sstream>
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/seekg/wchar_t/fstream.cc b/libstdc++-v3/testsuite/27_io/basic_istream/seekg/wchar_t/fstream.cc
index b792c8bc5cc..6dc69d57516 100644
--- a/libstdc++-v3/testsuite/27_io/basic_istream/seekg/wchar_t/fstream.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_istream/seekg/wchar_t/fstream.cc
@@ -16,11 +16,15 @@
// <http://www.gnu.org/licenses/>.
// { dg-require-fileio "" }
+// { dg-additional-files "wistream_seeks-1.tst" }
+// { dg-additional-files "wistream_seeks-1.txt" }
+// { dg-additional-files "wistream_seeks-2.tst" }
+// Do not create wistream_seeks-2.txt, we want it to be created as empty.
+// { dg-final { file-io-diff "wistream_seeks-1" } }
+// { dg-final { file-io-diff "wistream_seeks-2" } }
-// 27.6.1.3 unformatted input functions
+// C++98 27.6.1.3 unformatted input functions
// NB: ostream has a particular "seeks" category. Adopt this for istreams too.
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %-*.txt
#include <istream>
#include <sstream>
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/tellg/char/fstream.cc b/libstdc++-v3/testsuite/27_io/basic_istream/tellg/char/fstream.cc
index a1eabd6abb4..8ab130a0a71 100644
--- a/libstdc++-v3/testsuite/27_io/basic_istream/tellg/char/fstream.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_istream/tellg/char/fstream.cc
@@ -17,12 +17,16 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// 27.6.1.3 unformatted input functions
+// C++98 27.6.1.3 unformatted input functions
// NB: ostream has a particular "seeks" category. Adopt this for istreams too.
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %-*.txt
// { dg-require-fileio "" }
+// { dg-additional-files "istream_seeks-1.tst" }
+// { dg-additional-files "istream_seeks-1.txt" }
+// { dg-additional-files "istream_seeks-2.tst" }
+// Do not create istream_seeks-2.txt, we want it to be created as empty.
+// { dg-final { file-io-diff "istream_seeks-1" } }
+// { dg-final { file-io-diff "istream_seeks-2" } }
#include <istream>
#include <sstream>
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/tellg/wchar_t/fstream.cc b/libstdc++-v3/testsuite/27_io/basic_istream/tellg/wchar_t/fstream.cc
index 636193af7e3..b22871f0d7d 100644
--- a/libstdc++-v3/testsuite/27_io/basic_istream/tellg/wchar_t/fstream.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_istream/tellg/wchar_t/fstream.cc
@@ -16,11 +16,15 @@
// <http://www.gnu.org/licenses/>.
// { dg-require-fileio "" }
+// { dg-additional-files "wistream_seeks-1.tst" }
+// { dg-additional-files "wistream_seeks-1.txt" }
+// { dg-additional-files "wistream_seeks-2.tst" }
+// Do not create wistream_seeks-2.txt, we want it to be created as empty.
+// { dg-final { file-io-diff "wistream_seeks-1" } }
+// { dg-final { file-io-diff "wistream_seeks-2" } }
-// 27.6.1.3 unformatted input functions
+// C++98 27.6.1.3 unformatted input functions
// NB: ostream has a particular "seeks" category. Adopt this for istreams too.
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %-*.txt
#include <istream>
#include <sstream>
diff --git a/libstdc++-v3/testsuite/27_io/basic_ofstream/open/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_ofstream/open/char/1.cc
index 45227107cbd..a9086a595cb 100644
--- a/libstdc++-v3/testsuite/27_io/basic_ofstream/open/char/1.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_ofstream/open/char/1.cc
@@ -17,10 +17,9 @@
// C++98 27.8.1.10 ofstream member functions
-// { dg-additional-files "ofstream_members-1.tst" }
-// @diff@ %-*.tst %-*.txt
-
// { dg-require-fileio "" }
+// { dg-additional-files "ofstream_members-1.tst" }
+// { dg-final { file-io-diff "ofstream_members-1" } }
#include <ostream>
#include <fstream>
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/1.cc
index 6d30d0ce94f..86a0ee8e77d 100644
--- a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/1.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/1.cc
@@ -18,11 +18,13 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// 27.6.2.5.4 basic_ostream character inserters
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %-*.txt
+// C++98 27.6.2.5.3 basic_ostream inserters
// { dg-require-fileio "" }
+// { dg-additional-files "ostream_inserter_other-1.tst" }
+// { dg-additional-files "ostream_inserter_other-2.tst" }
+// { dg-final { file-io-diff "ostream_inserter_other-1" } }
+// { dg-final { file-io-diff "ostream_inserter_other-2" } }
#include <ostream>
#include <sstream>
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/2.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/2.cc
index 15f0d5f7b0b..735f2e20e9c 100644
--- a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/2.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/2.cc
@@ -18,9 +18,9 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// 27.6.2.5.4 basic_ostream character inserters
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %-*.txt
+// C++98 27.6.2.5.3 basic_ostream inserters
+
+// { dg-final { file-io-diff "ostream_inserter_other_in" "ostream_inserter_other_out" } }
#include <ostream>
#include <fstream>
@@ -56,6 +56,7 @@ test03(void)
out.seekp(0, ios_base::end);
i_read = in.tellg() - rs;
i_wrote = out.tellp() - ws;
+ VERIFY( i_read == i_wrote );
in.close();
out.close();
}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/wchar_t/1.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/wchar_t/1.cc
index 7692637e16d..1aecfa4f0e9 100644
--- a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/wchar_t/1.cc
@@ -15,11 +15,13 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// 27.6.2.5.4 basic_ostream character inserters
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %-*.txt
+// C++98 27.6.2.5.3 basic_ostream inserters
// { dg-require-fileio "" }
+// { dg-additional-files "wostream_inserter_other-1.tst" }
+// { dg-additional-files "wostream_inserter_other-2.tst" }
+// { dg-final { file-io-diff "wostream_inserter_other-1" } }
+// { dg-final { file-io-diff "wostream_inserter_other-2" } }
#include <ostream>
#include <sstream>
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/wchar_t/2.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/wchar_t/2.cc
index 856af56011a..663539a5b19 100644
--- a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/wchar_t/2.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/wchar_t/2.cc
@@ -15,9 +15,9 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// 27.6.2.5.4 basic_ostream character inserters
-// @require@ %-*.tst %-*.txt
-// @diff@ %-*.tst %-*.txt
+// C++98 27.6.2.5.3 basic_ostream inserters
+
+// { dg-final { file-io-diff "wostream_inserter_other_in.txt" "wostream_inserter_other_out.txt" } }
#include <ostream>
#include <fstream>
@@ -53,6 +53,7 @@ test03(void)
out.seekp(0, ios_base::end);
i_read = in.tellg() - rs;
i_wrote = out.tellp() - ws;
+ VERIFY( i_read == i_wrote );
in.close();
out.close();
}
diff --git a/libstdc++-v3/testsuite/27_io/ios_base/sync_with_stdio/1.cc b/libstdc++-v3/testsuite/27_io/ios_base/sync_with_stdio/1.cc
index 4f9f7c3e554..20cbc1e08cd 100644
--- a/libstdc++-v3/testsuite/27_io/ios_base/sync_with_stdio/1.cc
+++ b/libstdc++-v3/testsuite/27_io/ios_base/sync_with_stdio/1.cc
@@ -20,8 +20,9 @@
// <http://www.gnu.org/licenses/>.
// 27.4.2.4 ios_base static members
-// @require@ %-*.tst
-// @diff@ %-*.tst %-*.txt
+
+// { dg-additional-files "ios_base_members_static-1.tst" }
+// { dg-final { file-io-diff "ios_base_members_static-1" } }
#include <cstdio>
#include <sstream>
diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp b/libstdc++-v3/testsuite/lib/libstdc++.exp
index 8efc6f7f089..ef511949c7b 100644
--- a/libstdc++-v3/testsuite/lib/libstdc++.exp
+++ b/libstdc++-v3/testsuite/lib/libstdc++.exp
@@ -1674,3 +1674,35 @@ if { [info exists env(GCC_RUNTEST_PARALLELIZE_DIR)] \
}
}
+
+# Compare output file written by test to expected result.
+# With two arguments the comparison is done via 'diff arg1 arg2'.
+# With one argument the comparison is done via 'diff arg1.tst arg1.txt'.
+proc file-io-diff { args } {
+ set nargs [llength $args]
+ if { $nargs < 1 } {
+ error "too few arguments to file-io-diff"
+ }
+ if { $nargs > 2 } {
+ error "too many arguments to file-io-diff"
+ }
+ if { $nargs == 1 } {
+ set file1 [lindex $args 0]
+ set file2 "${file1}.txt"
+ append file1 ".tst"
+ } else {
+ set file1 [lindex $args 0]
+ set file2 [lindex $args 1]
+ }
+
+ spawn -noecho diff -u $file1 $file2
+ expect {
+ -re ".+" {
+ set msg "files differ\n"
+ append msg $expect_out(0,string)
+ fail $msg
+ exp_continue
+ }
+ }
+ return
+}
--
2.45.2
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 5/8] libstdc++: Use dg-additional-files in some algorithm tests
2024-07-22 16:28 [PATCH 1/8] libstdc++: Clean up @diff@ markup in some I/O tests Jonathan Wakely
` (2 preceding siblings ...)
2024-07-22 16:28 ` [PATCH 4/8] libstdc++: Add file-io-diff to replace @diff@ markup in " Jonathan Wakely
@ 2024-07-22 16:28 ` Jonathan Wakely
2024-07-22 16:28 ` [PATCH 6/8] libstdc++: Use dg-additional-files in some non-I/O tests Jonathan Wakely
` (3 subsequent siblings)
7 siblings, 0 replies; 12+ messages in thread
From: Jonathan Wakely @ 2024-07-22 16:28 UTC (permalink / raw)
To: libstdc++, gcc-patches
Tested x86_64-linux.
-- >8 --
Use the dg-additional-files directive to declare files that need to be
copied into the test's working directory. This is currently redundant
(as all .tst and .txt files are copied for all tests) but is a step
towards not copying all files.
libstdc++-v3/ChangeLog:
* testsuite/25_algorithms/advance/istreambuf_iterators/char/2.cc:
Use dg-additional-files.
* testsuite/25_algorithms/advance/istreambuf_iterators/wchar_t/2.cc:
Likewise.
* testsuite/25_algorithms/copy/streambuf_iterators/char/4.cc:
Likewise.
* testsuite/25_algorithms/copy/streambuf_iterators/wchar_t/4.cc:
Likewise.
* testsuite/25_algorithms/copy_n/istreambuf_iterator/2.cc:
Likewise.
* testsuite/25_algorithms/copy_n/istreambuf_iterator/deque.cc:
Likewise.
* testsuite/25_algorithms/find/istreambuf_iterators/char/2.cc:
Likewise.
* testsuite/25_algorithms/find/istreambuf_iterators/wchar_t/2.cc:
Likewise.
---
.../25_algorithms/advance/istreambuf_iterators/char/2.cc | 1 +
.../25_algorithms/advance/istreambuf_iterators/wchar_t/2.cc | 1 +
.../testsuite/25_algorithms/copy/streambuf_iterators/char/4.cc | 1 +
.../25_algorithms/copy/streambuf_iterators/wchar_t/4.cc | 1 +
.../testsuite/25_algorithms/copy_n/istreambuf_iterator/2.cc | 1 +
.../testsuite/25_algorithms/copy_n/istreambuf_iterator/deque.cc | 1 +
.../testsuite/25_algorithms/find/istreambuf_iterators/char/2.cc | 1 +
.../25_algorithms/find/istreambuf_iterators/wchar_t/2.cc | 1 +
8 files changed, 8 insertions(+)
diff --git a/libstdc++-v3/testsuite/25_algorithms/advance/istreambuf_iterators/char/2.cc b/libstdc++-v3/testsuite/25_algorithms/advance/istreambuf_iterators/char/2.cc
index 1a0635c0cca..c5414d4975d 100644
--- a/libstdc++-v3/testsuite/25_algorithms/advance/istreambuf_iterators/char/2.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/advance/istreambuf_iterators/char/2.cc
@@ -16,6 +16,7 @@
// <http://www.gnu.org/licenses/>.
// { dg-require-fileio "" }
+// { dg-additional-files "istream_unformatted-1.txt" }
#include <iterator>
#include <fstream>
diff --git a/libstdc++-v3/testsuite/25_algorithms/advance/istreambuf_iterators/wchar_t/2.cc b/libstdc++-v3/testsuite/25_algorithms/advance/istreambuf_iterators/wchar_t/2.cc
index 823e275da19..c2fd748cbf0 100644
--- a/libstdc++-v3/testsuite/25_algorithms/advance/istreambuf_iterators/wchar_t/2.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/advance/istreambuf_iterators/wchar_t/2.cc
@@ -16,6 +16,7 @@
// <http://www.gnu.org/licenses/>.
// { dg-require-fileio "" }
+// { dg-additional-files "istream_unformatted-1.txt" }
#include <iterator>
#include <fstream>
diff --git a/libstdc++-v3/testsuite/25_algorithms/copy/streambuf_iterators/char/4.cc b/libstdc++-v3/testsuite/25_algorithms/copy/streambuf_iterators/char/4.cc
index 67888797047..3d1c7c7595d 100644
--- a/libstdc++-v3/testsuite/25_algorithms/copy/streambuf_iterators/char/4.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/copy/streambuf_iterators/char/4.cc
@@ -27,6 +27,7 @@
#include <testsuite_hooks.h>
// { dg-require-fileio "" }
+// { dg-additional-files "istream_unformatted-1.txt" }
// In the occasion of libstdc++/25482
void test01()
diff --git a/libstdc++-v3/testsuite/25_algorithms/copy/streambuf_iterators/wchar_t/4.cc b/libstdc++-v3/testsuite/25_algorithms/copy/streambuf_iterators/wchar_t/4.cc
index e1adccfdd21..8d380052313 100644
--- a/libstdc++-v3/testsuite/25_algorithms/copy/streambuf_iterators/wchar_t/4.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/copy/streambuf_iterators/wchar_t/4.cc
@@ -18,6 +18,7 @@
// <http://www.gnu.org/licenses/>.
// { dg-require-fileio "" }
+// { dg-additional-files "istream_unformatted-1.txt" }
#include <iterator>
#include <fstream>
diff --git a/libstdc++-v3/testsuite/25_algorithms/copy_n/istreambuf_iterator/2.cc b/libstdc++-v3/testsuite/25_algorithms/copy_n/istreambuf_iterator/2.cc
index 5179d78b455..a437bedb420 100644
--- a/libstdc++-v3/testsuite/25_algorithms/copy_n/istreambuf_iterator/2.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/copy_n/istreambuf_iterator/2.cc
@@ -1,5 +1,6 @@
// { dg-do run { target c++11 } }
// { dg-require-fileio "" }
+// { dg-additional-files "istream_unformatted-1.txt" }
// Copyright (C) 2020-2024 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/25_algorithms/copy_n/istreambuf_iterator/deque.cc b/libstdc++-v3/testsuite/25_algorithms/copy_n/istreambuf_iterator/deque.cc
index 14f58998fef..1353282f6a0 100644
--- a/libstdc++-v3/testsuite/25_algorithms/copy_n/istreambuf_iterator/deque.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/copy_n/istreambuf_iterator/deque.cc
@@ -1,5 +1,6 @@
// { dg-do run { target c++11 } }
// { dg-require-fileio "" }
+// { dg-additional-files "istream_unformatted-1.txt" }
// Copyright (C) 2020-2024 Free Software Foundation, Inc.
//
diff --git a/libstdc++-v3/testsuite/25_algorithms/find/istreambuf_iterators/char/2.cc b/libstdc++-v3/testsuite/25_algorithms/find/istreambuf_iterators/char/2.cc
index 2a33bbaac9f..7a682edff7c 100644
--- a/libstdc++-v3/testsuite/25_algorithms/find/istreambuf_iterators/char/2.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/find/istreambuf_iterators/char/2.cc
@@ -23,6 +23,7 @@
#include <testsuite_hooks.h>
// { dg-require-fileio "" }
+// { dg-additional-files "istream_unformatted-1.txt" }
// In the occasion of libstdc++/25482
void test01()
diff --git a/libstdc++-v3/testsuite/25_algorithms/find/istreambuf_iterators/wchar_t/2.cc b/libstdc++-v3/testsuite/25_algorithms/find/istreambuf_iterators/wchar_t/2.cc
index dfe5926c18a..c3187d17639 100644
--- a/libstdc++-v3/testsuite/25_algorithms/find/istreambuf_iterators/wchar_t/2.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/find/istreambuf_iterators/wchar_t/2.cc
@@ -18,6 +18,7 @@
// <http://www.gnu.org/licenses/>.
// { dg-require-fileio "" }
+// { dg-additional-files "istream_unformatted-1.txt" }
#include <iterator>
#include <fstream>
--
2.45.2
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 6/8] libstdc++: Use dg-additional-files in some non-I/O tests
2024-07-22 16:28 [PATCH 1/8] libstdc++: Clean up @diff@ markup in some I/O tests Jonathan Wakely
` (3 preceding siblings ...)
2024-07-22 16:28 ` [PATCH 5/8] libstdc++: Use dg-additional-files in some algorithm tests Jonathan Wakely
@ 2024-07-22 16:28 ` Jonathan Wakely
2024-07-22 16:28 ` [PATCH 7/8] libstdc++: Stop copying all data files into test directory Jonathan Wakely
` (2 subsequent siblings)
7 siblings, 0 replies; 12+ messages in thread
From: Jonathan Wakely @ 2024-07-22 16:28 UTC (permalink / raw)
To: libstdc++, gcc-patches
Tested x86_64-linux.
-- >8 --
libstdc++-v3/ChangeLog:
* testsuite/20_util/hash/chi2_q_document_words.cc: Use
dg-additional-files for input text.
* testsuite/performance/ext/pb_ds/all_text_find.cc: Likewise.
* testsuite/performance/ext/pb_ds/multimap_text_find.hpp:
Likewise.
* testsuite/performance/ext/pb_ds/multimap_text_insert.hpp:
Likewise.
* testsuite/performance/ext/pb_ds/multimap_text_insert_mem.hpp:
Likewise.
* testsuite/performance/ext/pb_ds/priority_queue_text_join.cc:
Likewise.
* testsuite/performance/ext/pb_ds/priority_queue_text_modify.hpp: Likewise.
* testsuite/performance/ext/pb_ds/priority_queue_text_pop_mem.cc: Likewise.
* testsuite/performance/ext/pb_ds/priority_queue_text_push.cc:
Likewise.
* testsuite/performance/ext/pb_ds/priority_queue_text_push_pop.cc: Likewise.
* testsuite/performance/ext/pb_ds/tree_text_insert.cc: Likewise.
* testsuite/performance/ext/pb_ds/tree_text_lor_find.cc:
Likewise.
---
libstdc++-v3/testsuite/20_util/hash/chi2_q_document_words.cc | 2 ++
libstdc++-v3/testsuite/performance/ext/pb_ds/all_text_find.cc | 2 ++
.../testsuite/performance/ext/pb_ds/multimap_text_find.hpp | 2 ++
.../testsuite/performance/ext/pb_ds/multimap_text_insert.hpp | 2 ++
.../performance/ext/pb_ds/multimap_text_insert_mem.hpp | 2 ++
.../testsuite/performance/ext/pb_ds/priority_queue_text_join.cc | 2 ++
.../performance/ext/pb_ds/priority_queue_text_modify.hpp | 2 ++
.../performance/ext/pb_ds/priority_queue_text_pop_mem.cc | 2 ++
.../testsuite/performance/ext/pb_ds/priority_queue_text_push.cc | 2 ++
.../performance/ext/pb_ds/priority_queue_text_push_pop.cc | 2 ++
.../testsuite/performance/ext/pb_ds/tree_text_insert.cc | 2 ++
.../testsuite/performance/ext/pb_ds/tree_text_lor_find.cc | 2 ++
12 files changed, 24 insertions(+)
diff --git a/libstdc++-v3/testsuite/20_util/hash/chi2_q_document_words.cc b/libstdc++-v3/testsuite/20_util/hash/chi2_q_document_words.cc
index a6ebc0011eb..3c77527c27c 100644
--- a/libstdc++-v3/testsuite/20_util/hash/chi2_q_document_words.cc
+++ b/libstdc++-v3/testsuite/20_util/hash/chi2_q_document_words.cc
@@ -19,6 +19,8 @@
// along with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
+// { dg-additional-files "thirty_years_among_the_dead_preproc.txt" }
+
#include "chi2_quality.h"
// Tests chi^2 for a set of words taken from a document written in English.
diff --git a/libstdc++-v3/testsuite/performance/ext/pb_ds/all_text_find.cc b/libstdc++-v3/testsuite/performance/ext/pb_ds/all_text_find.cc
index 13c73a76647..df822c3d5f7 100644
--- a/libstdc++-v3/testsuite/performance/ext/pb_ds/all_text_find.cc
+++ b/libstdc++-v3/testsuite/performance/ext/pb_ds/all_text_find.cc
@@ -29,6 +29,8 @@
// purpose. It is provided "as is" without express or implied
// warranty.
+// { dg-additional-files "thirty_years_among_the_dead_preproc.txt" }
+
/**
* @file text_find_timing_test.cpp
* Contains test for finding text.
diff --git a/libstdc++-v3/testsuite/performance/ext/pb_ds/multimap_text_find.hpp b/libstdc++-v3/testsuite/performance/ext/pb_ds/multimap_text_find.hpp
index 18e383ea17c..dbaaf04a1b6 100644
--- a/libstdc++-v3/testsuite/performance/ext/pb_ds/multimap_text_find.hpp
+++ b/libstdc++-v3/testsuite/performance/ext/pb_ds/multimap_text_find.hpp
@@ -29,6 +29,8 @@
// purpose. It is provided "as is" without express or implied
// warranty.
+// { dg-additional-files "thirty_years_among_the_dead_preproc.txt" }
+
/**
* @file multimap_text_find_timing_test.cpp
* Contains test for inserting text words.
diff --git a/libstdc++-v3/testsuite/performance/ext/pb_ds/multimap_text_insert.hpp b/libstdc++-v3/testsuite/performance/ext/pb_ds/multimap_text_insert.hpp
index 737be39a154..2c86b52f30a 100644
--- a/libstdc++-v3/testsuite/performance/ext/pb_ds/multimap_text_insert.hpp
+++ b/libstdc++-v3/testsuite/performance/ext/pb_ds/multimap_text_insert.hpp
@@ -29,6 +29,8 @@
// purpose. It is provided "as is" without express or implied
// warranty.
+// { dg-additional-files "thirty_years_among_the_dead_preproc.txt" }
+
/**
* @file multimap_text_insert_timing_test.cpp
* Contains test for inserting text words.
diff --git a/libstdc++-v3/testsuite/performance/ext/pb_ds/multimap_text_insert_mem.hpp b/libstdc++-v3/testsuite/performance/ext/pb_ds/multimap_text_insert_mem.hpp
index 9ce235381bd..ab755312c69 100644
--- a/libstdc++-v3/testsuite/performance/ext/pb_ds/multimap_text_insert_mem.hpp
+++ b/libstdc++-v3/testsuite/performance/ext/pb_ds/multimap_text_insert_mem.hpp
@@ -29,6 +29,8 @@
// purpose. It is provided "as is" without express or implied
// warranty.
+// { dg-additional-files "thirty_years_among_the_dead_preproc.txt" }
+
/**
* @file multimap_text_insert_mem_usage_test.cpp
* Contains test for inserting text words.
diff --git a/libstdc++-v3/testsuite/performance/ext/pb_ds/priority_queue_text_join.cc b/libstdc++-v3/testsuite/performance/ext/pb_ds/priority_queue_text_join.cc
index a515eea8009..aee52539fce 100644
--- a/libstdc++-v3/testsuite/performance/ext/pb_ds/priority_queue_text_join.cc
+++ b/libstdc++-v3/testsuite/performance/ext/pb_ds/priority_queue_text_join.cc
@@ -29,6 +29,8 @@
// purpose. It is provided "as is" without express or implied
// warranty.
+// { dg-additional-files "thirty_years_among_the_dead_preproc.txt" }
+
/**
* @file priority_queue_text_join_timing_test.cpp
* Contains test for finding text.
diff --git a/libstdc++-v3/testsuite/performance/ext/pb_ds/priority_queue_text_modify.hpp b/libstdc++-v3/testsuite/performance/ext/pb_ds/priority_queue_text_modify.hpp
index cb62b616105..108b67284c3 100644
--- a/libstdc++-v3/testsuite/performance/ext/pb_ds/priority_queue_text_modify.hpp
+++ b/libstdc++-v3/testsuite/performance/ext/pb_ds/priority_queue_text_modify.hpp
@@ -29,6 +29,8 @@
// purpose. It is provided "as is" without express or implied
// warranty.
+// { dg-additional-files "thirty_years_among_the_dead_preproc.txt" }
+
/**
* @file priority_queue_text_modify_timing_test.cpp
* Contains test for finding text.
diff --git a/libstdc++-v3/testsuite/performance/ext/pb_ds/priority_queue_text_pop_mem.cc b/libstdc++-v3/testsuite/performance/ext/pb_ds/priority_queue_text_pop_mem.cc
index 0a1003fe0f5..862de9858f9 100644
--- a/libstdc++-v3/testsuite/performance/ext/pb_ds/priority_queue_text_pop_mem.cc
+++ b/libstdc++-v3/testsuite/performance/ext/pb_ds/priority_queue_text_pop_mem.cc
@@ -29,6 +29,8 @@
// purpose. It is provided "as is" without express or implied
// warranty.
+// { dg-additional-files "thirty_years_among_the_dead_preproc.txt" }
+
/**
* @file priority_queue_text_push_pop_timing_test.cpp
* Contains test for finding text.
diff --git a/libstdc++-v3/testsuite/performance/ext/pb_ds/priority_queue_text_push.cc b/libstdc++-v3/testsuite/performance/ext/pb_ds/priority_queue_text_push.cc
index 5a25a9a1925..4ba1fa3174a 100644
--- a/libstdc++-v3/testsuite/performance/ext/pb_ds/priority_queue_text_push.cc
+++ b/libstdc++-v3/testsuite/performance/ext/pb_ds/priority_queue_text_push.cc
@@ -29,6 +29,8 @@
// purpose. It is provided "as is" without express or implied
// warranty.
+// { dg-additional-files "thirty_years_among_the_dead_preproc.txt" }
+
/**
* @file priority_queue_text_push_timing_test.cpp
* Contains test for finding text.
diff --git a/libstdc++-v3/testsuite/performance/ext/pb_ds/priority_queue_text_push_pop.cc b/libstdc++-v3/testsuite/performance/ext/pb_ds/priority_queue_text_push_pop.cc
index 4013cd28be0..0a1280962ec 100644
--- a/libstdc++-v3/testsuite/performance/ext/pb_ds/priority_queue_text_push_pop.cc
+++ b/libstdc++-v3/testsuite/performance/ext/pb_ds/priority_queue_text_push_pop.cc
@@ -29,6 +29,8 @@
// purpose. It is provided "as is" without express or implied
// warranty.
+// { dg-additional-files "thirty_years_among_the_dead_preproc.txt" }
+
/**
* @file priority_queue_text_push_pop_timing_test.cpp
* Contains test for finding text.
diff --git a/libstdc++-v3/testsuite/performance/ext/pb_ds/tree_text_insert.cc b/libstdc++-v3/testsuite/performance/ext/pb_ds/tree_text_insert.cc
index 760006ec5ca..f439cad0c4e 100644
--- a/libstdc++-v3/testsuite/performance/ext/pb_ds/tree_text_insert.cc
+++ b/libstdc++-v3/testsuite/performance/ext/pb_ds/tree_text_insert.cc
@@ -29,6 +29,8 @@
// purpose. It is provided "as is" without express or implied
// warranty.
+// { dg-additional-files "thirty_years_among_the_dead_preproc.txt" }
+
/**
* @file tree_text_insert_timing_test.cpp
* Contains test for finding text.
diff --git a/libstdc++-v3/testsuite/performance/ext/pb_ds/tree_text_lor_find.cc b/libstdc++-v3/testsuite/performance/ext/pb_ds/tree_text_lor_find.cc
index 53ed5538101..04dabccf74e 100644
--- a/libstdc++-v3/testsuite/performance/ext/pb_ds/tree_text_lor_find.cc
+++ b/libstdc++-v3/testsuite/performance/ext/pb_ds/tree_text_lor_find.cc
@@ -29,6 +29,8 @@
// purpose. It is provided "as is" without express or implied
// warranty.
+// { dg-additional-files "thirty_years_among_the_dead_preproc.txt" }
+
/**
* @file tree_text_lor_find_timing_test.cpp
* Contains test for finding text with locality of reference.
--
2.45.2
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 7/8] libstdc++: Stop copying all data files into test directory
2024-07-22 16:28 [PATCH 1/8] libstdc++: Clean up @diff@ markup in some I/O tests Jonathan Wakely
` (4 preceding siblings ...)
2024-07-22 16:28 ` [PATCH 6/8] libstdc++: Use dg-additional-files in some non-I/O tests Jonathan Wakely
@ 2024-07-22 16:28 ` Jonathan Wakely
2024-07-25 1:32 ` Andrew Pinski
2024-07-22 16:28 ` [PATCH 8/8] libstdc++: Rename tests [PR12048] Jonathan Wakely
2024-07-24 11:26 ` [PATCH 1/8] libstdc++: Clean up @diff@ markup in some I/O tests Jonathan Wakely
7 siblings, 1 reply; 12+ messages in thread
From: Jonathan Wakely @ 2024-07-22 16:28 UTC (permalink / raw)
To: libstdc++, gcc-patches
Tested x86_64-linux.
-- >8 --
This removes the TODO in libstdc++_init, so that we don't copy all *.tst
and *.txt files from testsuite/data into every test's working directory.
Instead, only the necessary files declared with dg-additional-files are
copied.
libstdc++-v3/ChangeLog:
* testsuite/lib/libstdc++.exp (libstdc++_init): Do not copy all
data files into test directory.
---
libstdc++-v3/testsuite/lib/libstdc++.exp | 5 -----
1 file changed, 5 deletions(-)
diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp b/libstdc++-v3/testsuite/lib/libstdc++.exp
index ef511949c7b..4bf88e72d05 100644
--- a/libstdc++-v3/testsuite/lib/libstdc++.exp
+++ b/libstdc++-v3/testsuite/lib/libstdc++.exp
@@ -158,11 +158,6 @@ proc libstdc++_init { testfile } {
global dg-do-what-default
set dg-do-what-default run
- # Copy all required data files.
- # TODO: Use dg-additional-files in individual tests instead of doing this.
- v3-copy-files [glob -nocomplain "$srcdir/data/*.tst"]
- v3-copy-files [glob -nocomplain "$srcdir/data/*.txt"]
-
set ld_library_path_tmp ""
# Locate libgcc.a so we don't need to account for different values of
--
2.45.2
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 8/8] libstdc++: Rename tests [PR12048]
2024-07-22 16:28 [PATCH 1/8] libstdc++: Clean up @diff@ markup in some I/O tests Jonathan Wakely
` (5 preceding siblings ...)
2024-07-22 16:28 ` [PATCH 7/8] libstdc++: Stop copying all data files into test directory Jonathan Wakely
@ 2024-07-22 16:28 ` Jonathan Wakely
2024-07-24 11:26 ` [PATCH 1/8] libstdc++: Clean up @diff@ markup in some I/O tests Jonathan Wakely
7 siblings, 0 replies; 12+ messages in thread
From: Jonathan Wakely @ 2024-07-22 16:28 UTC (permalink / raw)
To: libstdc++, gcc-patches
Tested x86_64-linux.
-- >8 --
These have the wrong PR number in the filenames.
libstdc++-v3/ChangeLog:
PR libstdc++/12048
* testsuite/ext/stdio_sync_filebuf/wchar_t/12948-1.cc: Move to...
* testsuite/ext/stdio_sync_filebuf/wchar_t/12048-1.cc: ...here.
* testsuite/ext/stdio_sync_filebuf/wchar_t/12948-2.cc: Move to...
* testsuite/ext/stdio_sync_filebuf/wchar_t/12048-2.cc: ...here.
* testsuite/ext/stdio_sync_filebuf/wchar_t/12948-3.cc: Move to...
* testsuite/ext/stdio_sync_filebuf/wchar_t/12048-3.cc: ...here.
* testsuite/ext/stdio_sync_filebuf/wchar_t/12948-4.cc: Move to...
* testsuite/ext/stdio_sync_filebuf/wchar_t/12048-4.cc: ...here.
---
.../ext/stdio_sync_filebuf/wchar_t/{12948-1.cc => 12048-1.cc} | 0
.../ext/stdio_sync_filebuf/wchar_t/{12948-2.cc => 12048-2.cc} | 0
.../ext/stdio_sync_filebuf/wchar_t/{12948-3.cc => 12048-3.cc} | 0
.../ext/stdio_sync_filebuf/wchar_t/{12948-4.cc => 12048-4.cc} | 0
4 files changed, 0 insertions(+), 0 deletions(-)
rename libstdc++-v3/testsuite/ext/stdio_sync_filebuf/wchar_t/{12948-1.cc => 12048-1.cc} (100%)
rename libstdc++-v3/testsuite/ext/stdio_sync_filebuf/wchar_t/{12948-2.cc => 12048-2.cc} (100%)
rename libstdc++-v3/testsuite/ext/stdio_sync_filebuf/wchar_t/{12948-3.cc => 12048-3.cc} (100%)
rename libstdc++-v3/testsuite/ext/stdio_sync_filebuf/wchar_t/{12948-4.cc => 12048-4.cc} (100%)
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/12048-1.cc
similarity index 100%
rename from libstdc++-v3/testsuite/ext/stdio_sync_filebuf/wchar_t/12948-1.cc
rename to libstdc++-v3/testsuite/ext/stdio_sync_filebuf/wchar_t/12048-1.cc
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/12048-2.cc
similarity index 100%
rename from libstdc++-v3/testsuite/ext/stdio_sync_filebuf/wchar_t/12948-2.cc
rename to libstdc++-v3/testsuite/ext/stdio_sync_filebuf/wchar_t/12048-2.cc
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/12048-3.cc
similarity index 100%
rename from libstdc++-v3/testsuite/ext/stdio_sync_filebuf/wchar_t/12948-3.cc
rename to libstdc++-v3/testsuite/ext/stdio_sync_filebuf/wchar_t/12048-3.cc
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/12048-4.cc
similarity index 100%
rename from libstdc++-v3/testsuite/ext/stdio_sync_filebuf/wchar_t/12948-4.cc
rename to libstdc++-v3/testsuite/ext/stdio_sync_filebuf/wchar_t/12048-4.cc
--
2.45.2
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/8] libstdc++: Clean up @diff@ markup in some I/O tests
2024-07-22 16:28 [PATCH 1/8] libstdc++: Clean up @diff@ markup in some I/O tests Jonathan Wakely
` (6 preceding siblings ...)
2024-07-22 16:28 ` [PATCH 8/8] libstdc++: Rename tests [PR12048] Jonathan Wakely
@ 2024-07-24 11:26 ` Jonathan Wakely
7 siblings, 0 replies; 12+ messages in thread
From: Jonathan Wakely @ 2024-07-24 11:26 UTC (permalink / raw)
To: libstdc++, gcc-patches
I've pushed this series to trunk now.
On Mon, 22 Jul 2024 at 17:34, Jonathan Wakely <jwakely@redhat.com> wrote:
>
> Tested x86_64-linux.
>
> -- >8 --
>
> We have a number of 27_io/* tests with comments like this:
>
> // @require@ %-*.tst
> // @diff@ %-*.tst %-*.txt
>
> It seems that these declare required data files used by the test and a
> post-test action to compare the test output with the expected result.
> We do have tests that depend on some *.tst and/or *.txt files that are
> copied from testsuite/data into each test's working directory before it
> runs, so the comments are related to those dependencies. However,
> nothing in the current test framework actually makes use of these
> comments. Currently, every test gets a fresh copy of every *.tst and
> *.txt file in the testsuite/data directory, whether the test actually
> requires them or not.
>
> This change is the first in a series to clean up this unused markup in
> the tests. This first step is to just remove all @require@ and @diff@
> comments where they seem to serve no purpose at all. These tests do not
> open any of the *.tst or *.txt files that are copied into the test's
> working directory from the testsuite/data directory, so they don't
> "require" any of those files, and there's no need to "diff" them after
> the test runs.
>
> libstdc++-v3/ChangeLog:
>
> * testsuite/27_io/basic_filebuf/close/char/4879.cc: Remove
> @require@ and @diff@ comments.
> * testsuite/27_io/basic_filebuf/close/char/9964.cc: Likewise.
> * testsuite/27_io/basic_filebuf/open/char/3.cc: Likewise.
> * testsuite/27_io/basic_filebuf/open/char/9507.cc: Likewise.
> * testsuite/27_io/basic_filebuf/sbumpc/char/1-out.cc: Likewise.
> * testsuite/27_io/basic_filebuf/sbumpc/char/2-out.cc: Likewise.
> * testsuite/27_io/basic_filebuf/sgetc/char/1-out.cc: Likewise.
> * testsuite/27_io/basic_filebuf/sgetc/char/2-out.cc: Likewise.
> * testsuite/27_io/basic_filebuf/sgetn/char/1-out.cc: Likewise.
> * testsuite/27_io/basic_filebuf/sgetn/char/2-out.cc: Likewise.
> * testsuite/27_io/basic_filebuf/snextc/char/2-out.cc: Likewise.
> * testsuite/27_io/basic_filebuf/sputbackc/char/1-io.cc:
> Likewise.
> * testsuite/27_io/basic_filebuf/sputbackc/char/1-out.cc:
> Likewise.
> * testsuite/27_io/basic_filebuf/sputbackc/char/2-io.cc:
> Likewise.
> * testsuite/27_io/basic_filebuf/sputbackc/char/2-out.cc:
> Likewise.
> * testsuite/27_io/basic_filebuf/sputc/char/1-out.cc: Likewise.
> * testsuite/27_io/basic_filebuf/sputc/char/2-out.cc: Likewise.
> * testsuite/27_io/basic_filebuf/sputn/char/1-out.cc: Likewise.
> * testsuite/27_io/basic_filebuf/sputn/char/2-out.cc: Likewise.
> * testsuite/27_io/basic_filebuf/sungetc/char/1-io.cc: Likewise.
> * testsuite/27_io/basic_filebuf/sungetc/char/1-out.cc: Likewise.
> * testsuite/27_io/basic_filebuf/sungetc/char/2-io.cc: Likewise.
> * testsuite/27_io/basic_filebuf/sungetc/char/2-out.cc: Likewise.
> * testsuite/27_io/basic_filebuf/sputc/char/1-io.cc: Likewise.
> Remove unused variable.
> * testsuite/27_io/basic_filebuf/sputn/char/2-io.cc: Likewise.
> * testsuite/27_io/basic_ofstream/cons/char/1.cc: Remove
> @require@ and @diff@ comments. Remove unused variables.
> * testsuite/27_io/basic_ofstream/rdbuf/char/2832.cc: Remove
> * testsuite/27_io/ios_base/sync_with_stdio/2.cc: Likewise.
> ---
> .../testsuite/27_io/basic_filebuf/close/char/4879.cc | 4 +---
> .../testsuite/27_io/basic_filebuf/close/char/9964.cc | 4 +---
> .../testsuite/27_io/basic_filebuf/open/char/3.cc | 4 +---
> .../testsuite/27_io/basic_filebuf/open/char/9507.cc | 4 +---
> .../testsuite/27_io/basic_filebuf/sbumpc/char/1-out.cc | 5 +----
> .../testsuite/27_io/basic_filebuf/sbumpc/char/2-out.cc | 5 +----
> .../testsuite/27_io/basic_filebuf/sgetc/char/1-out.cc | 5 +----
> .../testsuite/27_io/basic_filebuf/sgetc/char/2-out.cc | 5 +----
> .../testsuite/27_io/basic_filebuf/sgetn/char/1-out.cc | 5 +----
> .../testsuite/27_io/basic_filebuf/sgetn/char/2-out.cc | 5 +----
> .../testsuite/27_io/basic_filebuf/snextc/char/2-out.cc | 5 +----
> .../27_io/basic_filebuf/sputbackc/char/1-io.cc | 5 +----
> .../27_io/basic_filebuf/sputbackc/char/1-out.cc | 5 +----
> .../27_io/basic_filebuf/sputbackc/char/2-io.cc | 5 +----
> .../27_io/basic_filebuf/sputbackc/char/2-out.cc | 5 +----
> .../testsuite/27_io/basic_filebuf/sputc/char/1-io.cc | 6 +-----
> .../testsuite/27_io/basic_filebuf/sputc/char/1-out.cc | 5 +----
> .../testsuite/27_io/basic_filebuf/sputc/char/2-out.cc | 5 +----
> .../testsuite/27_io/basic_filebuf/sputn/char/1-out.cc | 5 +----
> .../testsuite/27_io/basic_filebuf/sputn/char/2-io.cc | 6 +-----
> .../testsuite/27_io/basic_filebuf/sputn/char/2-out.cc | 5 +----
> .../testsuite/27_io/basic_filebuf/sungetc/char/1-io.cc | 3 ---
> .../27_io/basic_filebuf/sungetc/char/1-out.cc | 3 ---
> .../testsuite/27_io/basic_filebuf/sungetc/char/2-io.cc | 3 ---
> .../27_io/basic_filebuf/sungetc/char/2-out.cc | 3 ---
> .../testsuite/27_io/basic_ofstream/cons/char/1.cc | 4 +---
> .../testsuite/27_io/basic_ofstream/rdbuf/char/2832.cc | 10 +---------
> .../testsuite/27_io/ios_base/sync_with_stdio/2.cc | 4 +---
> 28 files changed, 24 insertions(+), 109 deletions(-)
>
> diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/4879.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/4879.cc
> index 22ccbe70e58..febc8f31a15 100644
> --- a/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/4879.cc
> +++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/4879.cc
> @@ -18,9 +18,7 @@
> // with this library; see the file COPYING3. If not see
> // <http://www.gnu.org/licenses/>.
>
> -// 27.8.1.3 filebuf member functions
> -// @require@ %-*.tst %-*.txt
> -// @diff@ %-*.tst %-*.txt
> +// C++98 27.8.1.3 filebuf member functions
>
> // various tests for filebuf::open() and filebuf::close() including
> // the non-portable functionality in the libstdc++-v3 IO library
> diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/9964.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/9964.cc
> index d9d73493c2a..796bf5ebdff 100644
> --- a/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/9964.cc
> +++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/9964.cc
> @@ -18,9 +18,7 @@
> // with this library; see the file COPYING3. If not see
> // <http://www.gnu.org/licenses/>.
>
> -// 27.8.1.3 filebuf member functions
> -// @require@ %-*.tst %-*.txt
> -// @diff@ %-*.tst %-*.txt
> +// C++98 27.8.1.3 filebuf member functions
>
> // various tests for filebuf::open() and filebuf::close() including
> // the non-portable functionality in the libstdc++-v3 IO library
> diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/3.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/3.cc
> index 46ce5032502..abfe2f5731c 100644
> --- a/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/3.cc
> +++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/3.cc
> @@ -15,9 +15,7 @@
> // with this library; see the file COPYING3. If not see
> // <http://www.gnu.org/licenses/>.
>
> -// 27.8.1.3 filebuf member functions
> -// @require@ %-*.tst %-*.txt
> -// @diff@ %-*.tst %-*.txt
> +// C++98 27.8.1.3 filebuf member functions
>
> // various tests for filebuf::open() and filebuf::close() including
> // the non-portable functionality in the libstdc++-v3 IO library
> diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/9507.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/9507.cc
> index 79ab5d6d756..4af5ed3a90d 100644
> --- a/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/9507.cc
> +++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/9507.cc
> @@ -17,9 +17,7 @@
> // with this library; see the file COPYING3. If not see
> // <http://www.gnu.org/licenses/>.
>
> -// 27.8.1.3 filebuf member functions
> -// @require@ %-*.tst %-*.txt
> -// @diff@ %-*.tst %-*.txt
> +// C++98 27.8.1.3 filebuf member functions
>
> // various tests for filebuf::open() and filebuf::close() including
> // the non-portable functionality in the libstdc++-v3 IO library
> diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/1-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/1-out.cc
> index 378f7dc275d..a955ae2d494 100644
> --- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/1-out.cc
> +++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/1-out.cc
> @@ -17,15 +17,12 @@
> // 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
>
> #include <fstream>
> #include <testsuite_hooks.h>
> #include <testsuite_io.h>
>
> -// @require@ %-*.tst %-*.txt
> -// @diff@ %-*.tst %*.txt
> -
> const char name_02[] = "tmp_sbumpc_1out.tst"; // empty file, need to create
>
> void test05()
> diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/2-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/2-out.cc
> index df1df2b9f88..e78c37cb3ab 100644
> --- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/2-out.cc
> +++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/2-out.cc
> @@ -17,15 +17,12 @@
> // 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
>
> #include <fstream>
> #include <testsuite_hooks.h>
> #include <testsuite_io.h>
>
> -// @require@ %-*.tst %-*.txt
> -// @diff@ %-*.tst %*.txt
> -
> const char name_02[] = "tmp_sbumpc_2out.tst"; // empty file, need to create
>
> void test05()
> diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/1-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/1-out.cc
> index b941e4fd619..2d4355185d9 100644
> --- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/1-out.cc
> +++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/1-out.cc
> @@ -17,7 +17,7 @@
> // 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-require-fileio "" }
>
> @@ -25,9 +25,6 @@
> #include <testsuite_hooks.h>
> #include <testsuite_io.h>
>
> -// @require@ %-*.tst %-*.txt
> -// @diff@ %-*.tst %*.txt
> -
> const char name_02[] = "tmp_sgetc_1out.tst"; // empty file, need to create
>
> // Test overloaded virtual functions.
> diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/2-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/2-out.cc
> index 29d79e52c63..bf2082e4cc7 100644
> --- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/2-out.cc
> +++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/2-out.cc
> @@ -17,15 +17,12 @@
> // 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
>
> #include <fstream>
> #include <testsuite_hooks.h>
> #include <testsuite_io.h>
>
> -// @require@ %-*.tst %-*.txt
> -// @diff@ %-*.tst %*.txt
> -
> const char name_02[] = "tmp_sgetc_2out.tst"; // empty file, need to create
>
> // Test overloaded virtual functions.
> diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-out.cc
> index e5052b208b8..5377e69b6ca 100644
> --- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-out.cc
> +++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-out.cc
> @@ -17,15 +17,12 @@
> // 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
>
> #include <fstream>
> #include <testsuite_hooks.h>
> #include <testsuite_io.h>
>
> -// @require@ %-*.tst %-*.txt
> -// @diff@ %-*.tst %*.txt
> -
> const char name_02[] = "tmp_sgetn_1out.tst"; // empty file, need to create
>
> // Test overloaded virtual functions.
> diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/2-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/2-out.cc
> index 158b3c4f5c1..267310e836d 100644
> --- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/2-out.cc
> +++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/2-out.cc
> @@ -17,15 +17,12 @@
> // 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
>
> #include <fstream>
> #include <testsuite_hooks.h>
> #include <testsuite_io.h>
>
> -// @require@ %-*.tst %-*.txt
> -// @diff@ %-*.tst %*.txt
> -
> const char name_02[] = "tmp_sgetn_2out.tst"; // empty file, need to create
>
> // Test overloaded virtual functions.
> diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/2-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/2-out.cc
> index fac0654a86f..5003c848c42 100644
> --- a/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/2-out.cc
> +++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/2-out.cc
> @@ -17,15 +17,12 @@
> // 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
>
> #include <fstream>
> #include <testsuite_hooks.h>
> #include <testsuite_io.h>
>
> -// @require@ %-*.tst %-*.txt
> -// @diff@ %-*.tst %*.txt
> -
> const char name_02[] = "tmp_snextc_2out.tst"; // empty file, need to create
>
> void test05()
> diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/1-io.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/1-io.cc
> index 8c467fb404b..59b8970d470 100644
> --- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/1-io.cc
> +++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/1-io.cc
> @@ -17,7 +17,7 @@
> // 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-require-fileio "" }
>
> @@ -25,9 +25,6 @@
> #include <testsuite_hooks.h>
> #include <testsuite_io.h>
>
> -// @require@ %-*.tst %-*.txt
> -// @diff@ %-*.tst %*.txt
> -
> const char name_01[] = "tmp_sputbackc_1io.tst"; // empty file, need to create
>
> void test01()
> diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/1-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/1-out.cc
> index cd6c7aec457..01d1c59f8e7 100644
> --- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/1-out.cc
> +++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/1-out.cc
> @@ -17,7 +17,7 @@
> // 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-require-fileio "" }
>
> @@ -25,9 +25,6 @@
> #include <testsuite_hooks.h>
> #include <testsuite_io.h>
>
> -// @require@ %-*.tst %-*.txt
> -// @diff@ %-*.tst %*.txt
> -
> const char name_01[] = "tmp_sputbackc_1out.tst"; // empty file, need to create
>
> // Test overloaded virtual functions.
> diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/2-io.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/2-io.cc
> index c33009fdd1f..b2d86b6c54c 100644
> --- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/2-io.cc
> +++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/2-io.cc
> @@ -17,7 +17,7 @@
> // 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-require-fileio "" }
>
> @@ -25,9 +25,6 @@
> #include <testsuite_hooks.h>
> #include <testsuite_io.h>
>
> -// @require@ %-*.tst %-*.txt
> -// @diff@ %-*.tst %*.txt
> -
> const char name_01[] = "tmp_sputbackc_2io.tst"; // empty file, need to create
>
> void test01()
> diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/2-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/2-out.cc
> index f56c0620a39..102bcf86e66 100644
> --- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/2-out.cc
> +++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/2-out.cc
> @@ -17,7 +17,7 @@
> // 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-require-fileio "" }
>
> @@ -25,9 +25,6 @@
> #include <testsuite_hooks.h>
> #include <testsuite_io.h>
>
> -// @require@ %-*.tst %-*.txt
> -// @diff@ %-*.tst %*.txt
> -
> const char name_01[] = "tmp_sputbackc_2out.tst"; // empty file, need to create
>
> // Test overloaded virtual functions.
> diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1-io.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1-io.cc
> index 9bb32e237fd..25a82090c98 100644
> --- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1-io.cc
> +++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1-io.cc
> @@ -17,7 +17,7 @@
> // 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-require-fileio "" }
>
> @@ -25,10 +25,6 @@
> #include <testsuite_hooks.h>
> #include <testsuite_io.h>
>
> -// @require@ %-*.tst %-*.txt
> -// @diff@ %-*.tst %*.txt
> -
> -const char name_01[] = "filebuf_virtuals-1.txt"; // file with data in it
> const char name_03[] = "tmp_sputc_1io.tst";
>
> void test05()
> diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1-out.cc
> index 0bed58c0235..28ad3ce1b13 100644
> --- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1-out.cc
> +++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1-out.cc
> @@ -17,7 +17,7 @@
> // 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-require-fileio "" }
>
> @@ -25,9 +25,6 @@
> #include <testsuite_hooks.h>
> #include <testsuite_io.h>
>
> -// @require@ %-*.tst %-*.txt
> -// @diff@ %-*.tst %*.txt
> -
> const char name_02[] = "tmp_sputc_1out.tst"; // empty file, need to create
>
> void test05()
> diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/2-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/2-out.cc
> index dfe71b4a309..762ab6f62d5 100644
> --- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/2-out.cc
> +++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/2-out.cc
> @@ -17,7 +17,7 @@
> // 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-require-fileio "" }
>
> @@ -25,9 +25,6 @@
> #include <testsuite_hooks.h>
> #include <testsuite_io.h>
>
> -// @require@ %-*.tst %-*.txt
> -// @diff@ %-*.tst %*.txt
> -
> const char name_02[] = "tmp_sputc_2out.tst"; // empty file, need to create
>
> void test05()
> diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/1-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/1-out.cc
> index f3a203ee2ab..4bf37438b8d 100644
> --- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/1-out.cc
> +++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/1-out.cc
> @@ -17,7 +17,7 @@
> // 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-require-fileio "" }
>
> @@ -25,9 +25,6 @@
> #include <testsuite_hooks.h>
> #include <testsuite_io.h>
>
> -// @require@ %-*.tst %-*.txt
> -// @diff@ %-*.tst %*.txt
> -
> const char name_02[] = "tmp_sputn_1out.tst"; // empty file, need to create
>
> void test05()
> diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/2-io.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/2-io.cc
> index fb5a0dc6002..3f711ad5c56 100644
> --- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/2-io.cc
> +++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/2-io.cc
> @@ -17,7 +17,7 @@
> // 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-require-fileio "" }
>
> @@ -25,10 +25,6 @@
> #include <testsuite_hooks.h>
> #include <testsuite_io.h>
>
> -// @require@ %-*.tst %-*.txt
> -// @diff@ %-*.tst %*.txt
> -
> -const char name_01[] = "filebuf_virtuals-1.txt"; // file with data in it
> const char name_03[] = "tmp_sputn_2io.tst"; // empty file, need to create
>
> void test05()
> diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/2-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/2-out.cc
> index 5fc75543ab9..d1c252511f4 100644
> --- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/2-out.cc
> +++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/2-out.cc
> @@ -17,7 +17,7 @@
> // 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-require-fileio "" }
>
> @@ -25,9 +25,6 @@
> #include <testsuite_hooks.h>
> #include <testsuite_io.h>
>
> -// @require@ %-*.tst %-*.txt
> -// @diff@ %-*.tst %*.txt
> -
> const char name_02[] = "tmp_sputn_2out.tst"; // empty file, need to create
>
> void test05()
> diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/1-io.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/1-io.cc
> index b4ff4045886..cf28372d2d5 100644
> --- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/1-io.cc
> +++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/1-io.cc
> @@ -25,9 +25,6 @@
> #include <testsuite_hooks.h>
> #include <testsuite_io.h>
>
> -// @require@ %-*.tst %-*.txt
> -// @diff@ %-*.tst %*.txt
> -
> const char name_01[] = "tmp_sungetc_1io.tst"; // empty file, need to create
>
> void test01()
> diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/1-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/1-out.cc
> index 52c33f60eca..2a48362b1be 100644
> --- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/1-out.cc
> +++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/1-out.cc
> @@ -23,9 +23,6 @@
> #include <testsuite_hooks.h>
> #include <testsuite_io.h>
>
> -// @require@ %-*.tst %-*.txt
> -// @diff@ %-*.tst %*.txt
> -
> const char name_01[] = "tmp_sungetc_1out.tst"; // empty file, need to create
>
> // Test overloaded virtual functions.
> diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/2-io.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/2-io.cc
> index 0791f42d847..11239553476 100644
> --- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/2-io.cc
> +++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/2-io.cc
> @@ -25,9 +25,6 @@
> #include <testsuite_hooks.h>
> #include <testsuite_io.h>
>
> -// @require@ %-*.tst %-*.txt
> -// @diff@ %-*.tst %*.txt
> -
> const char name_01[] = "tmp_sungetc_2io.tst"; // empty file, need to create
>
> void test01()
> diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/2-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/2-out.cc
> index 76c61a1d8ce..d131fd8862e 100644
> --- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/2-out.cc
> +++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/2-out.cc
> @@ -23,9 +23,6 @@
> #include <testsuite_hooks.h>
> #include <testsuite_io.h>
>
> -// @require@ %-*.tst %-*.txt
> -// @diff@ %-*.tst %*.txt
> -
> const char name_01[] = "tmp_sungetc_2out.tst"; // empty file, need to create
>
> // Test overloaded virtual functions.
> diff --git a/libstdc++-v3/testsuite/27_io/basic_ofstream/cons/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_ofstream/cons/char/1.cc
> index 2c5c3d8525e..79f56b72dc7 100644
> --- a/libstdc++-v3/testsuite/27_io/basic_ofstream/cons/char/1.cc
> +++ b/libstdc++-v3/testsuite/27_io/basic_ofstream/cons/char/1.cc
> @@ -15,9 +15,7 @@
> // with this library; see the file COPYING3. If not see
> // <http://www.gnu.org/licenses/>.
>
> -// 27.8.1.10 ofstream member functions
> -// @require@ %-*.tst
> -// @diff@ %-*.tst %-*.txt
> +// C++98 27.8.1.10 ofstream member functions
>
> // { dg-require-fileio "" }
>
> diff --git a/libstdc++-v3/testsuite/27_io/basic_ofstream/rdbuf/char/2832.cc b/libstdc++-v3/testsuite/27_io/basic_ofstream/rdbuf/char/2832.cc
> index 0b1594bf2a7..15575f7c710 100644
> --- a/libstdc++-v3/testsuite/27_io/basic_ofstream/rdbuf/char/2832.cc
> +++ b/libstdc++-v3/testsuite/27_io/basic_ofstream/rdbuf/char/2832.cc
> @@ -15,16 +15,12 @@
> // with this library; see the file COPYING3. If not see
> // <http://www.gnu.org/licenses/>.
>
> -// 27.8.1.10 ofstream member functions
> -// @require@ %-*.tst
> -// @diff@ %-*.tst %-*.txt
> +// C++98 27.8.1.10 ofstream member functions
>
> #include <ostream>
> #include <fstream>
> #include <testsuite_hooks.h>
>
> -const char name_01[] = "ofstream_members-1.tst";
> -
> void
> redirect_buffer(std::ios& stream, std::streambuf* new_buf)
> { stream.rdbuf(new_buf); }
> @@ -36,10 +32,6 @@ active_buffer(std::ios& stream)
> // libstdc++/2832
> void test03()
> {
> - const char* strlit01 = "fuck war";
> - const std::string str00;
> - const std::string str01(strlit01);
> - std::string str02;
> std::filebuf fbuf;
> std::streambuf* pbasebuf0 = &fbuf;
>
> diff --git a/libstdc++-v3/testsuite/27_io/ios_base/sync_with_stdio/2.cc b/libstdc++-v3/testsuite/27_io/ios_base/sync_with_stdio/2.cc
> index 043bafbd32f..65908feffbd 100644
> --- a/libstdc++-v3/testsuite/27_io/ios_base/sync_with_stdio/2.cc
> +++ b/libstdc++-v3/testsuite/27_io/ios_base/sync_with_stdio/2.cc
> @@ -19,9 +19,7 @@
> // with this library; see the file COPYING3. If not see
> // <http://www.gnu.org/licenses/>.
>
> -// 27.4.2.4 ios_base static members
> -// @require@ %-*.tst
> -// @diff@ %-*.tst %-*.txt
> +// C++98 27.4.2.4 ios_base static members
>
> #include <cstdio>
> #include <sstream>
> --
> 2.45.2
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 7/8] libstdc++: Stop copying all data files into test directory
2024-07-22 16:28 ` [PATCH 7/8] libstdc++: Stop copying all data files into test directory Jonathan Wakely
@ 2024-07-25 1:32 ` Andrew Pinski
0 siblings, 0 replies; 12+ messages in thread
From: Andrew Pinski @ 2024-07-25 1:32 UTC (permalink / raw)
To: Jonathan Wakely; +Cc: libstdc++, gcc-patches
On Mon, Jul 22, 2024 at 9:35 AM Jonathan Wakely <jwakely@redhat.com> wrote:
>
> Tested x86_64-linux.
>
> -- >8 --
>
> This removes the TODO in libstdc++_init, so that we don't copy all *.tst
> and *.txt files from testsuite/data into every test's working directory.
> Instead, only the necessary files declared with dg-additional-files are
> copied.
Note one of these patches in this set broke testing in some cases.
The reason is that v3_additional_files will be " file1 file2" and
calling split on it, there will be an empty filename for the first
entry.
I have a patch which calls "string trim" on v3_additional_files before
calling split and that seems to fix the problem. I will post it once
my testsuite run is done.
Thanks,
Andrew Pinski
>
> libstdc++-v3/ChangeLog:
>
> * testsuite/lib/libstdc++.exp (libstdc++_init): Do not copy all
> data files into test directory.
> ---
> libstdc++-v3/testsuite/lib/libstdc++.exp | 5 -----
> 1 file changed, 5 deletions(-)
>
> diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp b/libstdc++-v3/testsuite/lib/libstdc++.exp
> index ef511949c7b..4bf88e72d05 100644
> --- a/libstdc++-v3/testsuite/lib/libstdc++.exp
> +++ b/libstdc++-v3/testsuite/lib/libstdc++.exp
> @@ -158,11 +158,6 @@ proc libstdc++_init { testfile } {
> global dg-do-what-default
> set dg-do-what-default run
>
> - # Copy all required data files.
> - # TODO: Use dg-additional-files in individual tests instead of doing this.
> - v3-copy-files [glob -nocomplain "$srcdir/data/*.tst"]
> - v3-copy-files [glob -nocomplain "$srcdir/data/*.txt"]
> -
> set ld_library_path_tmp ""
>
> # Locate libgcc.a so we don't need to account for different values of
> --
> 2.45.2
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Polish libstdc++ 'dg-final' action 'file-io-diff' (was: [PATCH 4/8] libstdc++: Add file-io-diff to replace @diff@ markup in I/O tests)
2024-07-22 16:28 ` [PATCH 4/8] libstdc++: Add file-io-diff to replace @diff@ markup in " Jonathan Wakely
@ 2024-07-29 16:02 ` Thomas Schwinge
2024-07-29 16:12 ` Jonathan Wakely
0 siblings, 1 reply; 12+ messages in thread
From: Thomas Schwinge @ 2024-07-29 16:02 UTC (permalink / raw)
To: Jonathan Wakely, libstdc++, gcc-patches
[-- Attachment #1: Type: text/plain, Size: 9732 bytes --]
Hi Jonathan!
On 2024-07-22T17:28:38+0100, Jonathan Wakely <jwakely@redhat.com> wrote:
> This adds a new dg-final action to compare two files after a test has
> run, [...]
Nice!
> --- a/libstdc++-v3/testsuite/lib/libstdc++.exp
> +++ b/libstdc++-v3/testsuite/lib/libstdc++.exp
> +# Compare output file written by test to expected result.
> +# With two arguments the comparison is done via 'diff arg1 arg2'.
> +# With one argument the comparison is done via 'diff arg1.tst arg1.txt'.
> +proc file-io-diff { args } {
> + set nargs [llength $args]
> + if { $nargs < 1 } {
> + error "too few arguments to file-io-diff"
> + }
> + if { $nargs > 2 } {
> + error "too many arguments to file-io-diff"
> + }
> + if { $nargs == 1 } {
> + set file1 [lindex $args 0]
> + set file2 "${file1}.txt"
> + append file1 ".tst"
> + } else {
> + set file1 [lindex $args 0]
> + set file2 [lindex $args 1]
> + }
> +
> + spawn -noecho diff -u $file1 $file2
> + expect {
> + -re ".+" {
> + set msg "files differ\n"
> + append msg $expect_out(0,string)
> + fail $msg
> + exp_continue
> + }
> + }
> + return
> +}
Via "deficient" GCN and nvptx target testing of my WIP C++ enablement
trees, I ran into a minor nuisance here; OK to push the attached
"Polish libstdc++ 'dg-final' action 'file-io-diff'"?
On a proper target, powerpc64le GNU/Linux, with:
$ echo yo >> libstdc++-v3/testsuite/data/istream_extractor_other-2.tst
... injected just for demonstration purposes (triggering for
'27_io/basic_istream/extractors_other/char/2.cc' one instance of
'FAIL: files differ'), my patch changes 'libstdc++.sum' as follows:
--- build-gcc/powerpc64le-unknown-linux-gnu/libstdc++-v3/testsuite/libstdc++.sum 2024-07-29 17:11:42.333879749 +0200
+++ build-gcc/powerpc64le-unknown-linux-gnu/libstdc++-v3/testsuite/libstdc++.sum 2024-07-29 15:46:27.528214632 +0200
@@ -1,2 +1,2 @@
-Test run by tschwinge on Mon Jul 29 16:53:34 2024
+Test run by tschwinge on Mon Jul 29 15:28:20 2024
Native configuration is powerpc64le-unknown-linux-gnu
@@ -11075,2 +11075,3 @@
PASS: 27_io/basic_filebuf/close/12790-1.cc -std=gnu++17 execution test
+PASS: 27_io/basic_filebuf/close/char/1.cc -std=gnu++17 file-io-diff filebuf_members-1
PASS: 27_io/basic_filebuf/close/char/1.cc -std=gnu++17 (test for excess errors)
@@ -11722,2 +11723,4 @@
PASS: 27_io/basic_istream/extractors_other/char/1.cc -std=gnu++17 execution test
+PASS: 27_io/basic_istream/extractors_other/char/2.cc -std=gnu++17 file-io-diff istream_extractor_other-1
+FAIL: 27_io/basic_istream/extractors_other/char/2.cc -std=gnu++17 file-io-diff istream_extractor_other-2
PASS: 27_io/basic_istream/extractors_other/char/2.cc -std=gnu++17 (test for excess errors)
@@ -11748,2 +11751,4 @@
PASS: 27_io/basic_istream/extractors_other/wchar_t/1.cc -std=gnu++17 execution test
+PASS: 27_io/basic_istream/extractors_other/wchar_t/2.cc -std=gnu++17 file-io-diff wistream_extractor_other-1
+PASS: 27_io/basic_istream/extractors_other/wchar_t/2.cc -std=gnu++17 file-io-diff wistream_extractor_other-2
PASS: 27_io/basic_istream/extractors_other/wchar_t/2.cc -std=gnu++17 (test for excess errors)
@@ -11772,2 +11777,3 @@
PASS: 27_io/basic_istream/get/char/1.cc -std=gnu++17 execution test
+PASS: 27_io/basic_istream/get/char/2.cc -std=gnu++17 file-io-diff istream_unformatted-1
PASS: 27_io/basic_istream/get/char/2.cc -std=gnu++17 (test for excess errors)
@@ -11779,2 +11785,3 @@
PASS: 27_io/basic_istream/get/wchar_t/1.cc -std=gnu++17 execution test
+PASS: 27_io/basic_istream/get/wchar_t/2.cc -std=gnu++17 file-io-diff istream_unformatted-1
PASS: 27_io/basic_istream/get/wchar_t/2.cc -std=gnu++17 (test for excess errors)
@@ -11812,2 +11819,3 @@
PASS: 27_io/basic_istream/ignore/char/2.cc -std=gnu++17 execution test
+PASS: 27_io/basic_istream/ignore/char/3.cc -std=gnu++17 file-io-diff istream_unformatted-1
PASS: 27_io/basic_istream/ignore/char/3.cc -std=gnu++17 (test for excess errors)
@@ -11828,2 +11836,3 @@
PASS: 27_io/basic_istream/ignore/wchar_t/2.cc -std=gnu++17 execution test
+PASS: 27_io/basic_istream/ignore/wchar_t/3.cc -std=gnu++17 file-io-diff istream_unformatted-1
PASS: 27_io/basic_istream/ignore/wchar_t/3.cc -std=gnu++17 (test for excess errors)
@@ -11844,2 +11853,3 @@
PASS: 27_io/basic_istream/peek/char/12296.cc -std=gnu++17 execution test
+PASS: 27_io/basic_istream/peek/char/6414.cc -std=gnu++17 file-io-diff istream_seeks-1
PASS: 27_io/basic_istream/peek/char/6414.cc -std=gnu++17 (test for excess errors)
@@ -11850,2 +11860,3 @@
PASS: 27_io/basic_istream/peek/wchar_t/12296.cc -std=gnu++17 execution test
+PASS: 27_io/basic_istream/peek/wchar_t/6414.cc -std=gnu++17 file-io-diff wistream_seeks-1
PASS: 27_io/basic_istream/peek/wchar_t/6414.cc -std=gnu++17 (test for excess errors)
@@ -11893,2 +11904,4 @@
PASS: 27_io/basic_istream/seekg/char/exceptions_badbit_throw.cc -std=gnu++17 execution test
+PASS: 27_io/basic_istream/seekg/char/fstream.cc -std=gnu++17 file-io-diff istream_seeks-1
+PASS: 27_io/basic_istream/seekg/char/fstream.cc -std=gnu++17 file-io-diff istream_seeks-2
PASS: 27_io/basic_istream/seekg/char/fstream.cc -std=gnu++17 (test for excess errors)
@@ -11907,2 +11920,4 @@
PASS: 27_io/basic_istream/seekg/wchar_t/exceptions_badbit_throw.cc -std=gnu++17 execution test
+PASS: 27_io/basic_istream/seekg/wchar_t/fstream.cc -std=gnu++17 file-io-diff wistream_seeks-1
+PASS: 27_io/basic_istream/seekg/wchar_t/fstream.cc -std=gnu++17 file-io-diff wistream_seeks-2
PASS: 27_io/basic_istream/seekg/wchar_t/fstream.cc -std=gnu++17 (test for excess errors)
@@ -11941,2 +11956,4 @@
PASS: 27_io/basic_istream/tellg/char/exceptions_badbit_throw.cc -std=gnu++17 execution test
+PASS: 27_io/basic_istream/tellg/char/fstream.cc -std=gnu++17 file-io-diff istream_seeks-1
+PASS: 27_io/basic_istream/tellg/char/fstream.cc -std=gnu++17 file-io-diff istream_seeks-2
PASS: 27_io/basic_istream/tellg/char/fstream.cc -std=gnu++17 (test for excess errors)
@@ -11955,2 +11972,4 @@
PASS: 27_io/basic_istream/tellg/wchar_t/exceptions_badbit_throw.cc -std=gnu++17 execution test
+PASS: 27_io/basic_istream/tellg/wchar_t/fstream.cc -std=gnu++17 file-io-diff wistream_seeks-1
+PASS: 27_io/basic_istream/tellg/wchar_t/fstream.cc -std=gnu++17 file-io-diff wistream_seeks-2
PASS: 27_io/basic_istream/tellg/wchar_t/fstream.cc -std=gnu++17 (test for excess errors)
@@ -12026,2 +12045,3 @@
PASS: 27_io/basic_ofstream/native_handle/wchar_t/1.cc -std=gnu++26 execution test
+PASS: 27_io/basic_ofstream/open/char/1.cc -std=gnu++17 file-io-diff ofstream_members-1
PASS: 27_io/basic_ofstream/open/char/1.cc -std=gnu++17 (test for excess errors)
@@ -12221,4 +12241,7 @@
PASS: 27_io/basic_ostream/inserters_character/wchar_t/deleted.cc -std=gnu++26 (test for excess errors)
+PASS: 27_io/basic_ostream/inserters_other/char/1.cc -std=gnu++17 file-io-diff ostream_inserter_other-1
+PASS: 27_io/basic_ostream/inserters_other/char/1.cc -std=gnu++17 file-io-diff ostream_inserter_other-2
PASS: 27_io/basic_ostream/inserters_other/char/1.cc -std=gnu++17 (test for excess errors)
PASS: 27_io/basic_ostream/inserters_other/char/1.cc -std=gnu++17 execution test
+PASS: 27_io/basic_ostream/inserters_other/char/2.cc -std=gnu++17 file-io-diff ostream_inserter_other_in ostream_inserter_other_out
PASS: 27_io/basic_ostream/inserters_other/char/2.cc -std=gnu++17 (test for excess errors)
@@ -12255,4 +12278,7 @@
PASS: 27_io/basic_ostream/inserters_other/char/volatile_ptr.cc -std=gnu++26 execution test
+PASS: 27_io/basic_ostream/inserters_other/wchar_t/1.cc -std=gnu++17 file-io-diff wostream_inserter_other-1
+PASS: 27_io/basic_ostream/inserters_other/wchar_t/1.cc -std=gnu++17 file-io-diff wostream_inserter_other-2
PASS: 27_io/basic_ostream/inserters_other/wchar_t/1.cc -std=gnu++17 (test for excess errors)
PASS: 27_io/basic_ostream/inserters_other/wchar_t/1.cc -std=gnu++17 execution test
+PASS: 27_io/basic_ostream/inserters_other/wchar_t/2.cc -std=gnu++17 file-io-diff wostream_inserter_other_in.txt wostream_inserter_other_out.txt
PASS: 27_io/basic_ostream/inserters_other/wchar_t/2.cc -std=gnu++17 (test for excess errors)
@@ -13103,2 +13129,3 @@
PASS: 27_io/ios_base/storage/68197.cc -std=gnu++17 execution test
+PASS: 27_io/ios_base/sync_with_stdio/1.cc -std=gnu++17 file-io-diff ios_base_members_static-1
PASS: 27_io/ios_base/sync_with_stdio/1.cc -std=gnu++17 (test for excess errors)
@@ -16601,3 +16628,2 @@
PASS: ext/vstring/types/23767.cc -std=gnu++17 (test for excess errors)
-FAIL: files differ
PASS: special_functions/01_assoc_laguerre/check_nan.cc -std=gnu++17 (test for excess errors)
@@ -19501,3 +19527,3 @@
-# of expected passes 18615
+# of expected passes 18641
# of unexpected failures 1
Note several instances of 'PASS: [...] file-io-diff [...]' appear, and
the unspecific 'FAIL: files differ' (near the end) turn into specific:
FAIL: 27_io/basic_istream/extractors_other/char/2.cc -std=gnu++17 file-io-diff istream_extractor_other-2
(Again, that FAIL's injected for demonstration purposes only.)
The '*.log' and '*.sum' files also look as expected.
Grüße
Thomas
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Polish-libstdc-dg-final-action-file-io-diff.patch --]
[-- Type: text/x-diff, Size: 3251 bytes --]
From 5309eeb8f74a690711474679b059e52d4f6ab8ca Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <tschwinge@baylibre.com>
Date: Mon, 29 Jul 2024 13:32:36 +0200
Subject: [PATCH] Polish libstdc++ 'dg-final' action 'file-io-diff'
Follow-up to recent commit 515da03a838db05443ebcc4c543a405bed764188
"libstdc++: Add file-io-diff to replace @diff@ markup in I/O tests".
Currently, if a 'dg-final' action 'file-io-diff' passes, we print nothing
(should: 'PASS: [...]'), but if it fails, we just print: 'FAIL: files differ',
for example ('*.log' file):
[...]
FAIL: 27_io/basic_ostream/inserters_other/wchar_t/2.cc -std=gnu++17 (test for excess errors)
[...]
UNRESOLVED: 27_io/basic_ostream/inserters_other/wchar_t/2.cc -std=gnu++17 compilation failed to produce executable
diff: wostream_inserter_other_in.txt: No such file or directory
diff: wostream_inserter_other_out.txt: No such file or directory
FAIL: files differ
diff: wostream_inserter_other_in.txt: No such file or directory
diff: wostream_inserter_other_out.txt: No such file or directory
When later the '*.sum' files get sorted, these 'FAIL: files differ' instances
aren't grouped anymore with the other test cases' results, but they appear en
bloc, lexically sorted between ('e[...]' and 's[...]'), for example:
[...]
PASS: ext/vstring/types/23767.cc -std=gnu++17 (test for excess errors)
FAIL: files differ
FAIL: files differ
FAIL: files differ
PASS: special_functions/01_assoc_laguerre/check_nan.cc -std=gnu++17 (test for excess errors)
[...]
Also, we shouldn't emit the actual 'diff' into the '*.sum' file, but just into
the '*.log* file, and there's no need for 'spawn'/'expect', as we're not
matching any specific messages.
libstdc++-v3/
* testsuite/lib/libstdc++.exp (file-io-diff): Polish.
---
libstdc++-v3/testsuite/lib/libstdc++.exp | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp b/libstdc++-v3/testsuite/lib/libstdc++.exp
index c11e752ecfb..18331c80bc2 100644
--- a/libstdc++-v3/testsuite/lib/libstdc++.exp
+++ b/libstdc++-v3/testsuite/lib/libstdc++.exp
@@ -1671,6 +1671,8 @@ if { [info exists env(GCC_RUNTEST_PARALLELIZE_DIR)] \
}
+# Utility functions, invoked via dg-final.
+
# Compare output file written by test to expected result.
# With two arguments the comparison is done via 'diff arg1 arg2'.
# With one argument the comparison is done via 'diff arg1.tst arg1.txt'.
@@ -1682,6 +1684,10 @@ proc file-io-diff { args } {
if { $nargs > 2 } {
error "too many arguments to file-io-diff"
}
+
+ set testcase [testname-for-summary]
+ set description "$testcase file-io-diff $args"
+
if { $nargs == 1 } {
set file1 [lindex $args 0]
set file2 "${file1}.txt"
@@ -1691,14 +1697,11 @@ proc file-io-diff { args } {
set file2 [lindex $args 1]
}
- spawn -noecho diff -u $file1 $file2
- expect {
- -re ".+" {
- set msg "files differ\n"
- append msg $expect_out(0,string)
- fail $msg
- exp_continue
- }
+ if { [catch { exec diff -u $file1 $file2 } msg] } {
+ fail $description
+ verbose -log "'diff':\n$msg"
+ } else {
+ pass $description
}
return
}
--
2.34.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Polish libstdc++ 'dg-final' action 'file-io-diff' (was: [PATCH 4/8] libstdc++: Add file-io-diff to replace @diff@ markup in I/O tests)
2024-07-29 16:02 ` Polish libstdc++ 'dg-final' action 'file-io-diff' (was: [PATCH 4/8] libstdc++: Add file-io-diff to replace @diff@ markup in I/O tests) Thomas Schwinge
@ 2024-07-29 16:12 ` Jonathan Wakely
0 siblings, 0 replies; 12+ messages in thread
From: Jonathan Wakely @ 2024-07-29 16:12 UTC (permalink / raw)
To: Thomas Schwinge; +Cc: libstdc++, gcc-patches
On Mon, 29 Jul 2024 at 17:02, Thomas Schwinge <tschwinge@baylibre.com> wrote:
>
> Hi Jonathan!
>
> On 2024-07-22T17:28:38+0100, Jonathan Wakely <jwakely@redhat.com> wrote:
> > This adds a new dg-final action to compare two files after a test has
> > run, [...]
>
> Nice!
>
> > --- a/libstdc++-v3/testsuite/lib/libstdc++.exp
> > +++ b/libstdc++-v3/testsuite/lib/libstdc++.exp
>
> > +# Compare output file written by test to expected result.
> > +# With two arguments the comparison is done via 'diff arg1 arg2'.
> > +# With one argument the comparison is done via 'diff arg1.tst arg1.txt'.
> > +proc file-io-diff { args } {
> > + set nargs [llength $args]
> > + if { $nargs < 1 } {
> > + error "too few arguments to file-io-diff"
> > + }
> > + if { $nargs > 2 } {
> > + error "too many arguments to file-io-diff"
> > + }
> > + if { $nargs == 1 } {
> > + set file1 [lindex $args 0]
> > + set file2 "${file1}.txt"
> > + append file1 ".tst"
> > + } else {
> > + set file1 [lindex $args 0]
> > + set file2 [lindex $args 1]
> > + }
> > +
> > + spawn -noecho diff -u $file1 $file2
> > + expect {
> > + -re ".+" {
> > + set msg "files differ\n"
> > + append msg $expect_out(0,string)
> > + fail $msg
> > + exp_continue
> > + }
> > + }
> > + return
> > +}
>
> Via "deficient" GCN and nvptx target testing of my WIP C++ enablement
> trees, I ran into a minor nuisance here; OK to push the attached
> "Polish libstdc++ 'dg-final' action 'file-io-diff'"?
This is an excellent improvement to my janky tcl code, making the
output more conventional.
OK for trunk, thanks.
>
> On a proper target, powerpc64le GNU/Linux, with:
>
> $ echo yo >> libstdc++-v3/testsuite/data/istream_extractor_other-2.tst
>
> ... injected just for demonstration purposes (triggering for
> '27_io/basic_istream/extractors_other/char/2.cc' one instance of
> 'FAIL: files differ'), my patch changes 'libstdc++.sum' as follows:
>
> --- build-gcc/powerpc64le-unknown-linux-gnu/libstdc++-v3/testsuite/libstdc++.sum 2024-07-29 17:11:42.333879749 +0200
> +++ build-gcc/powerpc64le-unknown-linux-gnu/libstdc++-v3/testsuite/libstdc++.sum 2024-07-29 15:46:27.528214632 +0200
> @@ -1,2 +1,2 @@
> -Test run by tschwinge on Mon Jul 29 16:53:34 2024
> +Test run by tschwinge on Mon Jul 29 15:28:20 2024
> Native configuration is powerpc64le-unknown-linux-gnu
> @@ -11075,2 +11075,3 @@
> PASS: 27_io/basic_filebuf/close/12790-1.cc -std=gnu++17 execution test
> +PASS: 27_io/basic_filebuf/close/char/1.cc -std=gnu++17 file-io-diff filebuf_members-1
> PASS: 27_io/basic_filebuf/close/char/1.cc -std=gnu++17 (test for excess errors)
> @@ -11722,2 +11723,4 @@
> PASS: 27_io/basic_istream/extractors_other/char/1.cc -std=gnu++17 execution test
> +PASS: 27_io/basic_istream/extractors_other/char/2.cc -std=gnu++17 file-io-diff istream_extractor_other-1
> +FAIL: 27_io/basic_istream/extractors_other/char/2.cc -std=gnu++17 file-io-diff istream_extractor_other-2
> PASS: 27_io/basic_istream/extractors_other/char/2.cc -std=gnu++17 (test for excess errors)
> @@ -11748,2 +11751,4 @@
> PASS: 27_io/basic_istream/extractors_other/wchar_t/1.cc -std=gnu++17 execution test
> +PASS: 27_io/basic_istream/extractors_other/wchar_t/2.cc -std=gnu++17 file-io-diff wistream_extractor_other-1
> +PASS: 27_io/basic_istream/extractors_other/wchar_t/2.cc -std=gnu++17 file-io-diff wistream_extractor_other-2
> PASS: 27_io/basic_istream/extractors_other/wchar_t/2.cc -std=gnu++17 (test for excess errors)
> @@ -11772,2 +11777,3 @@
> PASS: 27_io/basic_istream/get/char/1.cc -std=gnu++17 execution test
> +PASS: 27_io/basic_istream/get/char/2.cc -std=gnu++17 file-io-diff istream_unformatted-1
> PASS: 27_io/basic_istream/get/char/2.cc -std=gnu++17 (test for excess errors)
> @@ -11779,2 +11785,3 @@
> PASS: 27_io/basic_istream/get/wchar_t/1.cc -std=gnu++17 execution test
> +PASS: 27_io/basic_istream/get/wchar_t/2.cc -std=gnu++17 file-io-diff istream_unformatted-1
> PASS: 27_io/basic_istream/get/wchar_t/2.cc -std=gnu++17 (test for excess errors)
> @@ -11812,2 +11819,3 @@
> PASS: 27_io/basic_istream/ignore/char/2.cc -std=gnu++17 execution test
> +PASS: 27_io/basic_istream/ignore/char/3.cc -std=gnu++17 file-io-diff istream_unformatted-1
> PASS: 27_io/basic_istream/ignore/char/3.cc -std=gnu++17 (test for excess errors)
> @@ -11828,2 +11836,3 @@
> PASS: 27_io/basic_istream/ignore/wchar_t/2.cc -std=gnu++17 execution test
> +PASS: 27_io/basic_istream/ignore/wchar_t/3.cc -std=gnu++17 file-io-diff istream_unformatted-1
> PASS: 27_io/basic_istream/ignore/wchar_t/3.cc -std=gnu++17 (test for excess errors)
> @@ -11844,2 +11853,3 @@
> PASS: 27_io/basic_istream/peek/char/12296.cc -std=gnu++17 execution test
> +PASS: 27_io/basic_istream/peek/char/6414.cc -std=gnu++17 file-io-diff istream_seeks-1
> PASS: 27_io/basic_istream/peek/char/6414.cc -std=gnu++17 (test for excess errors)
> @@ -11850,2 +11860,3 @@
> PASS: 27_io/basic_istream/peek/wchar_t/12296.cc -std=gnu++17 execution test
> +PASS: 27_io/basic_istream/peek/wchar_t/6414.cc -std=gnu++17 file-io-diff wistream_seeks-1
> PASS: 27_io/basic_istream/peek/wchar_t/6414.cc -std=gnu++17 (test for excess errors)
> @@ -11893,2 +11904,4 @@
> PASS: 27_io/basic_istream/seekg/char/exceptions_badbit_throw.cc -std=gnu++17 execution test
> +PASS: 27_io/basic_istream/seekg/char/fstream.cc -std=gnu++17 file-io-diff istream_seeks-1
> +PASS: 27_io/basic_istream/seekg/char/fstream.cc -std=gnu++17 file-io-diff istream_seeks-2
> PASS: 27_io/basic_istream/seekg/char/fstream.cc -std=gnu++17 (test for excess errors)
> @@ -11907,2 +11920,4 @@
> PASS: 27_io/basic_istream/seekg/wchar_t/exceptions_badbit_throw.cc -std=gnu++17 execution test
> +PASS: 27_io/basic_istream/seekg/wchar_t/fstream.cc -std=gnu++17 file-io-diff wistream_seeks-1
> +PASS: 27_io/basic_istream/seekg/wchar_t/fstream.cc -std=gnu++17 file-io-diff wistream_seeks-2
> PASS: 27_io/basic_istream/seekg/wchar_t/fstream.cc -std=gnu++17 (test for excess errors)
> @@ -11941,2 +11956,4 @@
> PASS: 27_io/basic_istream/tellg/char/exceptions_badbit_throw.cc -std=gnu++17 execution test
> +PASS: 27_io/basic_istream/tellg/char/fstream.cc -std=gnu++17 file-io-diff istream_seeks-1
> +PASS: 27_io/basic_istream/tellg/char/fstream.cc -std=gnu++17 file-io-diff istream_seeks-2
> PASS: 27_io/basic_istream/tellg/char/fstream.cc -std=gnu++17 (test for excess errors)
> @@ -11955,2 +11972,4 @@
> PASS: 27_io/basic_istream/tellg/wchar_t/exceptions_badbit_throw.cc -std=gnu++17 execution test
> +PASS: 27_io/basic_istream/tellg/wchar_t/fstream.cc -std=gnu++17 file-io-diff wistream_seeks-1
> +PASS: 27_io/basic_istream/tellg/wchar_t/fstream.cc -std=gnu++17 file-io-diff wistream_seeks-2
> PASS: 27_io/basic_istream/tellg/wchar_t/fstream.cc -std=gnu++17 (test for excess errors)
> @@ -12026,2 +12045,3 @@
> PASS: 27_io/basic_ofstream/native_handle/wchar_t/1.cc -std=gnu++26 execution test
> +PASS: 27_io/basic_ofstream/open/char/1.cc -std=gnu++17 file-io-diff ofstream_members-1
> PASS: 27_io/basic_ofstream/open/char/1.cc -std=gnu++17 (test for excess errors)
> @@ -12221,4 +12241,7 @@
> PASS: 27_io/basic_ostream/inserters_character/wchar_t/deleted.cc -std=gnu++26 (test for excess errors)
> +PASS: 27_io/basic_ostream/inserters_other/char/1.cc -std=gnu++17 file-io-diff ostream_inserter_other-1
> +PASS: 27_io/basic_ostream/inserters_other/char/1.cc -std=gnu++17 file-io-diff ostream_inserter_other-2
> PASS: 27_io/basic_ostream/inserters_other/char/1.cc -std=gnu++17 (test for excess errors)
> PASS: 27_io/basic_ostream/inserters_other/char/1.cc -std=gnu++17 execution test
> +PASS: 27_io/basic_ostream/inserters_other/char/2.cc -std=gnu++17 file-io-diff ostream_inserter_other_in ostream_inserter_other_out
> PASS: 27_io/basic_ostream/inserters_other/char/2.cc -std=gnu++17 (test for excess errors)
> @@ -12255,4 +12278,7 @@
> PASS: 27_io/basic_ostream/inserters_other/char/volatile_ptr.cc -std=gnu++26 execution test
> +PASS: 27_io/basic_ostream/inserters_other/wchar_t/1.cc -std=gnu++17 file-io-diff wostream_inserter_other-1
> +PASS: 27_io/basic_ostream/inserters_other/wchar_t/1.cc -std=gnu++17 file-io-diff wostream_inserter_other-2
> PASS: 27_io/basic_ostream/inserters_other/wchar_t/1.cc -std=gnu++17 (test for excess errors)
> PASS: 27_io/basic_ostream/inserters_other/wchar_t/1.cc -std=gnu++17 execution test
> +PASS: 27_io/basic_ostream/inserters_other/wchar_t/2.cc -std=gnu++17 file-io-diff wostream_inserter_other_in.txt wostream_inserter_other_out.txt
> PASS: 27_io/basic_ostream/inserters_other/wchar_t/2.cc -std=gnu++17 (test for excess errors)
> @@ -13103,2 +13129,3 @@
> PASS: 27_io/ios_base/storage/68197.cc -std=gnu++17 execution test
> +PASS: 27_io/ios_base/sync_with_stdio/1.cc -std=gnu++17 file-io-diff ios_base_members_static-1
> PASS: 27_io/ios_base/sync_with_stdio/1.cc -std=gnu++17 (test for excess errors)
> @@ -16601,3 +16628,2 @@
> PASS: ext/vstring/types/23767.cc -std=gnu++17 (test for excess errors)
> -FAIL: files differ
> PASS: special_functions/01_assoc_laguerre/check_nan.cc -std=gnu++17 (test for excess errors)
> @@ -19501,3 +19527,3 @@
>
> -# of expected passes 18615
> +# of expected passes 18641
> # of unexpected failures 1
>
> Note several instances of 'PASS: [...] file-io-diff [...]' appear, and
> the unspecific 'FAIL: files differ' (near the end) turn into specific:
>
> FAIL: 27_io/basic_istream/extractors_other/char/2.cc -std=gnu++17 file-io-diff istream_extractor_other-2
>
> (Again, that FAIL's injected for demonstration purposes only.)
> The '*.log' and '*.sum' files also look as expected.
>
>
> Grüße
> Thomas
>
>
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2024-07-29 16:12 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-22 16:28 [PATCH 1/8] libstdc++: Clean up @diff@ markup in some I/O tests Jonathan Wakely
2024-07-22 16:28 ` [PATCH 2/8] libstdc++: Replace @require@ " Jonathan Wakely
2024-07-22 16:28 ` [PATCH 3/8] libstdc++: Use dg-additional-files " Jonathan Wakely
2024-07-22 16:28 ` [PATCH 4/8] libstdc++: Add file-io-diff to replace @diff@ markup in " Jonathan Wakely
2024-07-29 16:02 ` Polish libstdc++ 'dg-final' action 'file-io-diff' (was: [PATCH 4/8] libstdc++: Add file-io-diff to replace @diff@ markup in I/O tests) Thomas Schwinge
2024-07-29 16:12 ` Jonathan Wakely
2024-07-22 16:28 ` [PATCH 5/8] libstdc++: Use dg-additional-files in some algorithm tests Jonathan Wakely
2024-07-22 16:28 ` [PATCH 6/8] libstdc++: Use dg-additional-files in some non-I/O tests Jonathan Wakely
2024-07-22 16:28 ` [PATCH 7/8] libstdc++: Stop copying all data files into test directory Jonathan Wakely
2024-07-25 1:32 ` Andrew Pinski
2024-07-22 16:28 ` [PATCH 8/8] libstdc++: Rename tests [PR12048] Jonathan Wakely
2024-07-24 11:26 ` [PATCH 1/8] libstdc++: Clean up @diff@ markup in some I/O tests Jonathan Wakely
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).