aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
Diffstat (limited to 'gas')
-rw-r--r--gas/testsuite/ChangeLog13
-rw-r--r--gas/testsuite/gas/all/gas.exp2
-rw-r--r--gas/testsuite/gas/elf/elf.exp4
-rw-r--r--gas/testsuite/gas/m68k/all.exp2
-rw-r--r--gas/testsuite/gas/mep/complex-relocs.exp2
-rw-r--r--gas/testsuite/gas/mt/relocs.exp2
-rw-r--r--gas/testsuite/gas/symver/symver.exp2
-rw-r--r--gas/testsuite/lib/gas-defs.exp124
8 files changed, 25 insertions, 126 deletions
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index d158385..90b3bfc 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,5 +1,18 @@
2010-11-20 Richard Sandiford <rdsandiford@googlemail.com>
+ * lib/gas-defs.exp (regexp_diff): Delete.
+ (run_dump_test): Remove final "" argument in call to regexp_diff.
+ (run_list_test): Likewise.
+ (run_list_test_stdin): Likewise.
+ * gas/all/gas.exp (test_cond): Likewise.
+ * gas/elf/elf.exp (run_elf_list_test): Likewise.
+ * gas/m68k/all.exp: Likewise.
+ * gas/mep/complex-relocs.exp (regexp_test): Likewise.
+ * gas/mt/relocs.exp (regexp_test): Likewise.
+ * gas/symver/symver.exp (run_error_test): Likewise.
+
+2010-11-20 Richard Sandiford <rdsandiford@googlemail.com>
+
* lib/gas-defs.exp (load_common_lib): New function. Load
binutils-common.exp.
(is_elf_format, is_aout_format, is_pecoff_format): Delete.
diff --git a/gas/testsuite/gas/all/gas.exp b/gas/testsuite/gas/all/gas.exp
index 1dd7cbb..c41db98 100644
--- a/gas/testsuite/gas/all/gas.exp
+++ b/gas/testsuite/gas/all/gas.exp
@@ -308,7 +308,7 @@ proc test_cond {} {
send_log "$comp_output\n"
fail $testname
} else {
- if { [regexp_diff dump.out $srcdir/$subdir/cond.l ""] } {
+ if { [regexp_diff dump.out $srcdir/$subdir/cond.l] } {
fail $testname
} else {
pass $testname
diff --git a/gas/testsuite/gas/elf/elf.exp b/gas/testsuite/gas/elf/elf.exp
index 1aebf8a..3babe0b 100644
--- a/gas/testsuite/gas/elf/elf.exp
+++ b/gas/testsuite/gas/elf/elf.exp
@@ -9,7 +9,7 @@ proc run_elf_list_test { name suffix opts readelf_opts readelf_pipe } {
set file $srcdir/$subdir/$name
gas_run ${name}.s "$opts -o dump.o" ">&dump.out"
if { ![string match "" $opts]
- && [regexp_diff "dump.out" "${file}.l" ""] } then {
+ && [regexp_diff "dump.out" "${file}.l"] } then {
fail $testname
verbose "output is [file_contents "dump.out"]" 2
return
@@ -28,7 +28,7 @@ proc run_elf_list_test { name suffix opts readelf_opts readelf_pipe } {
return
}
verbose_eval {[file_contents "dump.out"]} 3
- if { [regexp_diff "dump.out" "${file}.e${suffix}" ""] } then {
+ if { [regexp_diff "dump.out" "${file}.e${suffix}"] } then {
fail $testname
verbose "output is [file_contents "dump.out"]" 2
return
diff --git a/gas/testsuite/gas/m68k/all.exp b/gas/testsuite/gas/m68k/all.exp
index 443fdb6..f4bdfa7 100644
--- a/gas/testsuite/gas/m68k/all.exp
+++ b/gas/testsuite/gas/m68k/all.exp
@@ -83,7 +83,7 @@ if { [istarget m68*-*-*] || [istarget fido*-*-*] } then {
verbose "$comp_output" 3
fail $testname
} else {
- if [regexp_diff "err.out" "$srcdir/$subdir/op68000.d" ""] then {
+ if [regexp_diff "err.out" "$srcdir/$subdir/op68000.d"] then {
fail $testname
} else {
pass $testname
diff --git a/gas/testsuite/gas/mep/complex-relocs.exp b/gas/testsuite/gas/mep/complex-relocs.exp
index a5a3127..83d89bb 100644
--- a/gas/testsuite/gas/mep/complex-relocs.exp
+++ b/gas/testsuite/gas/mep/complex-relocs.exp
@@ -18,7 +18,7 @@ proc objdump_test { exec flags dest test } {
}
proc regexp_test { file1 file2 test } {
- if [regexp_diff $file1 $file2 ""] then { fail $test } else { pass $test }
+ if [regexp_diff $file1 $file2] then { fail $test } else { pass $test }
}
diff --git a/gas/testsuite/gas/mt/relocs.exp b/gas/testsuite/gas/mt/relocs.exp
index d47742e..076f428 100644
--- a/gas/testsuite/gas/mt/relocs.exp
+++ b/gas/testsuite/gas/mt/relocs.exp
@@ -15,7 +15,7 @@ proc objdump_test { exec flags dest test } {
}
proc regexp_test { file1 file2 test } {
- if [regexp_diff $file1 $file2 ""] then { fail $test } else { pass $test }
+ if [regexp_diff $file1 $file2] then { fail $test } else { pass $test }
}
diff --git a/gas/testsuite/gas/symver/symver.exp b/gas/testsuite/gas/symver/symver.exp
index b4caae9..6fcae0e 100644
--- a/gas/testsuite/gas/symver/symver.exp
+++ b/gas/testsuite/gas/symver/symver.exp
@@ -6,7 +6,7 @@ proc run_error_test { name opts } {
set testname "symver $name"
set file $srcdir/$subdir/$name
gas_run ${name}.s $opts ">&dump.out"
- if { [regexp_diff "dump.out" "${file}.l" ""] } then {
+ if { [regexp_diff "dump.out" "${file}.l"] } then {
fail $testname
verbose "output is [file_contents "dump.out"]" 2
return
diff --git a/gas/testsuite/lib/gas-defs.exp b/gas/testsuite/lib/gas-defs.exp
index cacfb50..f10d72a 100644
--- a/gas/testsuite/lib/gas-defs.exp
+++ b/gas/testsuite/lib/gas-defs.exp
@@ -427,8 +427,8 @@ proc run_dump_tests { testcases {extra_options {}} } {
#
# After the option lines come regexp lines. `run_dump_test' calls
# `regexp_diff' to compare the output of the dumping tool against the
-# regexps in FILE.d. `regexp_diff' is defined later in this file; see
-# further comments there.
+# regexps in FILE.d. `regexp_diff' is defined in binutils-common.exp;
+# see further comments there.
proc run_dump_test { name {extra_options {}} } {
global subdir srcdir
@@ -679,7 +679,7 @@ proc run_dump_test { name {extra_options {}} } {
}
set stderrfile $srcdir/$subdir/$opts(stderr)
verbose "wrote pruned stderr to dump.stderr" 3
- if { [regexp_diff "dump.stderr" "$stderrfile" ""] } then {
+ if { [regexp_diff "dump.stderr" "$stderrfile"] } then {
if { $opts(error) != "" } {
verbose -log "$exitstat with: <$comp_output>, expected: <$opts(error)>"
if [regexp $opts(error) $comp_output] {
@@ -839,120 +839,6 @@ expect_after -i {
eof { perror "eof" }
}
-# regexp_diff, based on simple_diff taken from ld test suite.
-# Compares two files line-by-line.
-# FILE_1 contains strings, FILE_2 contains regexps and #-comments
-# Blank lines are ignored in either file.
-# Subsitutions in REF_SUBST are applied on FILE_2 lines.
-# Returns non-zero if differences exist.
-#
-proc regexp_diff { file_1 file_2 ref_subst} {
-
- set eof -1
- set end_1 0
- set end_2 0
- set differences 0
- set diff_pass 0
-
- if [file exists $file_1] then {
- set file_a [open $file_1 r]
- } else {
- perror "$file_1 doesn't exist"
- return 1
- }
-
- if [file exists $file_2] then {
- set file_b [open $file_2 r]
- } else {
- perror "$file_2 doesn't exist"
- close $file_a
- return 1
- }
-
- verbose " Regexp-diff'ing: $file_1 $file_2" 2
-
- while { 1 } {
- set line_a ""
- set line_b ""
- while { [string length $line_a] == 0 } {
- # Ignore blank line in FILE_1.
- if { [gets $file_a line_a] == $eof } {
- set end_1 1
- break
- }
- }
- while { [string length $line_b] == 0 || [string match "#*" $line_b] } {
- if [ string match "#pass" $line_b ] {
- set end_2 1
- set diff_pass 1
- break
- } elseif [ string match "#..." $line_b ] {
- if { [gets $file_b line_b] == $eof } {
- set end_2 1
- set diff_pass 1
- break
- }
- # Substitute on the reference.
- foreach {name value} $ref_subst {
- regsub -- $name $line_b $value line_b
- }
- verbose "looking for \"^$line_b$\"" 3
- while { ![regexp "^$line_b$" "$line_a"] } {
- verbose "skipping \"$line_a\"" 3
- if { [gets $file_a line_a] == $eof } {
- set end_1 1
- break
- }
- }
- break
- }
- if { [gets $file_b line_b] == $eof } {
- set end_2 1
- break
- }
- }
-
- if { $diff_pass } {
- break
- } elseif { $end_1 && $end_2 } {
- break
- } elseif { $end_1 } {
- send_log "extra regexps in $file_2 starting with \"^$line_b$\"\nEOF from $file_1\n"
- verbose "extra regexps in $file_2 starting with \"^$line_b$\"\nEOF from $file_1" 3
- set differences 1
- break
- } elseif { $end_2 } {
- send_log "extra lines in $file_1 starting with \"^$line_a$\"\nEOF from $file_2\n"
- verbose "extra lines in $file_1 starting with \"^$line_a$\"\nEOF from $file_2\n" 3
- set differences 1
- break
- } else {
- # Substitute on the reference.
- foreach {name value} $ref_subst {
- regsub -- $name $line_b $value line_b
- }
- verbose "regexp \"^$line_b$\"\nline \"$line_a\"" 3
- if ![regexp "^$line_b$" "$line_a"] {
- send_log "regexp_diff match failure\n"
- send_log "regexp \"^$line_b$\"\nline \"$line_a\"\n"
- verbose "regexp_diff match failure\n" 3
- set differences 1
- }
- }
- }
-
- if { $differences == 0 && !$diff_pass && [eof $file_a] != [eof $file_b] } {
- send_log "$file_1 and $file_2 are different lengths\n"
- verbose "$file_1 and $file_2 are different lengths" 3
- set differences 1
- }
-
- close $file_a
- close $file_b
-
- return $differences
-}
-
proc file_contents { filename } {
set file [open $filename r]
set contents [read $file]
@@ -1008,7 +894,7 @@ proc run_list_test { name {opts {}} {testname {}} } {
}
set file $srcdir/$subdir/$name
gas_run ${name}.s $opts ">&dump.out"
- if { [regexp_diff "dump.out" "${file}.l" ""] } then {
+ if { [regexp_diff "dump.out" "${file}.l"] } then {
fail $testname
verbose "output is [file_contents "dump.out"]" 2
return
@@ -1027,7 +913,7 @@ proc run_list_test_stdin { name {opts {}} {testname {}} } {
}
set file $srcdir/$subdir/$name
gas_run_stdin ${name}.s $opts ">&dump.out"
- if { [regexp_diff "dump.out" "${file}.l" ""] } then {
+ if { [regexp_diff "dump.out" "${file}.l"] } then {
fail $testname
verbose "output is [file_contents "dump.out"]" 2
return