From f0a2eecfdfcc438c74a82671d9ee5957b2999d32 Mon Sep 17 00:00:00 2001 From: hp Date: Mon, 18 Apr 2005 16:31:10 +0000 Subject: [PATCH] * 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 --- libffi/ChangeLog | 5 +++++ libffi/testsuite/lib/libffi-dg.exp | 16 ++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/libffi/ChangeLog b/libffi/ChangeLog index a9c2c07..bea9a89 100644 --- a/libffi/ChangeLog +++ b/libffi/ChangeLog @@ -1,3 +1,8 @@ +2005-04-18 Hans-Peter Nilsson + + * testsuite/lib/libffi-dg.exp (libffi-dg-test-1): Replace \n with + \r?\n in output tests. + 2005-04-12 Mike Stump * configure: Regenerate. diff --git a/libffi/testsuite/lib/libffi-dg.exp b/libffi/testsuite/lib/libffi-dg.exp index 49c7705..7b98711 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] -- 2.7.4