aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2021-04-13 00:32:11 +0930
committerAlan Modra <amodra@gmail.com>2021-04-13 01:20:37 +0930
commit4bb920c68e3a9e310095d54e0c4034c9cee12916 (patch)
tree16ad36cfdd78ff9a7a06230cd27b3fe8597d6996 /gas
parent6ba4cb845bd319f11d1caf42de5156daed28ff9d (diff)
downloadfsf-binutils-gdb-4bb920c68e3a9e310095d54e0c4034c9cee12916.zip
fsf-binutils-gdb-4bb920c68e3a9e310095d54e0c4034c9cee12916.tar.gz
fsf-binutils-gdb-4bb920c68e3a9e310095d54e0c4034c9cee12916.tar.bz2
m68hc11 gas testsuite wart
Writing to a potentially read-only source directory is not good. * testsuite/gas/m68hc11/m68hc11.exp (gas_m68hc11_message): Don't write to $srcdir. Use gas_host_run and read output file rather than gas_start/gas_finish.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog6
-rw-r--r--gas/testsuite/gas/m68hc11/m68hc11.exp22
2 files changed, 15 insertions, 13 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 1b1dafe..40fedbb 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,9 @@
+2021-04-13 Alan Modra <amodra@gmail.com>
+
+ * testsuite/gas/m68hc11/m68hc11.exp (gas_m68hc11_message): Don't
+ write to $srcdir. Use gas_host_run and read output file rather
+ than gas_start/gas_finish.
+
2021-04-12 Alan Modra <amodra@gmail.com>
* config/tc-ppc.c (insn_validate): Use uint64_t for operand values.
diff --git a/gas/testsuite/gas/m68hc11/m68hc11.exp b/gas/testsuite/gas/m68hc11/m68hc11.exp
index 1be2c99..d58448a 100644
--- a/gas/testsuite/gas/m68hc11/m68hc11.exp
+++ b/gas/testsuite/gas/m68hc11/m68hc11.exp
@@ -51,35 +51,31 @@ gas_m68hc11_opcode_list "-mm9s12xg" 74
# Test for a message produced when assembling a file
proc gas_m68hc11_message { kind options line expect } {
- global srcdir
- global subdir
+ global AS
+ global ASFLAGS
regsub -all "\n" "$line: $expect" " " title
# Make a file containing the instructions to assemble.
- set fd [open "$srcdir/$subdir/tst-m68hc1x.s" "w"]
+ set fd [open "tst-m68hc1x.s" "w"]
puts -nonewline $fd "$line"
close $fd
verbose -log "Test: $title"
- gas_start "tst-m68hc1x.s" "$options"
+ set status [gas_host_run "$AS $ASFLAGS $options tst-m68hc1x.s" ">&gas.out"]
set ok 0
- while 1 {
- expect {
- -re ".*: Assembler messages:\n" { }
- -re ".*1: $kind: $expect" { incr ok; break }
- timeout { perror "timeout\n"; break }
- eof { verbose "EOF from gas"; break }
+ set fd [open "gas.out" r]
+ while { [gets $fd outline] != -1 } {
+ if { [regexp ".*1: $kind: $expect" $outline] } {
+ incr ok
}
}
- #sleep 1 # Uncomment this line when using gcov
- gas_finish
if { $ok > 0 } then {
pass $title
} else {
fail $title
}
- catch "exec rm -f $srcdir/$subdir/tst-m68hc1x.s"
+ catch "exec rm -f tst-m68hc1x.s gas.out"
}
# Test for an error message produced by gas