summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhp <hp@138bc75d-0d04-0410-961f-82ee72b054a4>2005-04-18 16:31:10 +0000
committerhp <hp@138bc75d-0d04-0410-961f-82ee72b054a4>2005-04-18 16:31:10 +0000
commitf0a2eecfdfcc438c74a82671d9ee5957b2999d32 (patch)
treee30c0fc027e285d0f9246a9e98b7102fde5ee2cf
parentf155876e1f8a779829c906db3056dbc0202efbf0 (diff)
downloadgcc-f0a2eecfdfcc438c74a82671d9ee5957b2999d32.tar.gz
* testsuite/lib/libffi-dg.exp (libffi-dg-test-1): Replace \n with
\r?\n in output tests. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@98329 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--libffi/ChangeLog5
-rw-r--r--libffi/testsuite/lib/libffi-dg.exp16
2 files changed, 21 insertions, 0 deletions
diff --git a/libffi/ChangeLog b/libffi/ChangeLog
index a9c2c070104..bea9a898b10 100644
--- a/libffi/ChangeLog
+++ b/libffi/ChangeLog
@@ -1,3 +1,8 @@
+2005-04-18 Hans-Peter Nilsson <hp@axis.com>
+
+ * testsuite/lib/libffi-dg.exp (libffi-dg-test-1): Replace \n with
+ \r?\n in output tests.
+
2005-04-12 Mike Stump <mrs@apple.com>
* configure: Regenerate.
diff --git a/libffi/testsuite/lib/libffi-dg.exp b/libffi/testsuite/lib/libffi-dg.exp
index 49c7705dd23..7b987111d14 100644
--- a/libffi/testsuite/lib/libffi-dg.exp
+++ b/libffi/testsuite/lib/libffi-dg.exp
@@ -28,6 +28,22 @@ load_gcc_lib wrapper.exp
# Define libffi callbacks for dg.exp.
proc libffi-dg-test-1 { target_compile prog do_what extra_tool_flags } {
+
+ # To get all \n in dg-output test strings to match printf output
+ # in a system that outputs it as \015\012 (i.e. not just \012), we
+ # need to change all \n into \r?\n. As there is no dejagnu flag
+ # or hook to do that, we simply change the text being tested.
+ # Unfortunately, we have to know that the variable is called
+ # dg-output-text and lives in the caller of libffi-dg-test, which
+ # is two calls up. Overriding proc dg-output would be longer and
+ # would necessarily have the same assumption.
+ upvar 2 dg-output-text output_match
+
+ if { [llength $output_match] > 1 } {
+ set x [regsub -all "\n" [lindex $output_match 1] "\r?\n"]
+ set output_match [lreplace $output_match 1 1 $x]
+ }
+
# Set up the compiler flags, based on what we're going to do.
set options [list]