From 5f57cea3f66564abf5062e33ea31c0acd09efe82 Mon Sep 17 00:00:00 2001 From: Steve Chamberlain Date: Tue, 1 Aug 1995 01:31:42 +0000 Subject: [PATCH] * gasp.c (change_base): Don't modify numbers in strings. (pr7583) * testsuite/gas/gasp/*: New. --- gas/ChangeLog | 5 ++++ gas/gasp.c | 12 ++++++++++ gas/testsuite/gas/.Sanitize | 1 + gas/testsuite/gas/gasp/.Sanitize | 40 +++++++++++++++++++++++++++++++ gas/testsuite/gas/gasp/assign.asm | 13 ++++++++++ gas/testsuite/gas/gasp/assign.err | 1 + gas/testsuite/gas/gasp/assign.out | 22 +++++++++++++++++ gas/testsuite/gas/gasp/gasp.exp | 33 +++++++++++++++++++++++++ gas/testsuite/gas/gasp/pr7583.asm | 3 +++ gas/testsuite/gas/gasp/pr7583.out | 5 ++++ 10 files changed, 135 insertions(+) create mode 100644 gas/testsuite/gas/gasp/.Sanitize create mode 100644 gas/testsuite/gas/gasp/assign.asm create mode 100644 gas/testsuite/gas/gasp/assign.err create mode 100644 gas/testsuite/gas/gasp/assign.out create mode 100644 gas/testsuite/gas/gasp/gasp.exp create mode 100644 gas/testsuite/gas/gasp/pr7583.asm create mode 100644 gas/testsuite/gas/gasp/pr7583.out diff --git a/gas/ChangeLog b/gas/ChangeLog index d817da1a1d0..3d3269a674c 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +Mon Jul 31 18:19:26 1995 steve chamberlain + + * gasp.c (change_base): Don't modify numbers in strings. (pr7583) + * testsuite/gas/gasp/*: New. + Mon Jul 31 12:16:21 1995 Ian Lance Taylor * config/tc-ppc.h (SUB_SEGMENT_ALIGN): Define. From Niclas diff --git a/gas/gasp.c b/gas/gasp.c index 87e55a1dc76..c164412a89a 100644 --- a/gas/gasp.c +++ b/gas/gasp.c @@ -1362,6 +1362,18 @@ change_base (idx, in, out) idx++; } } + else if (in->ptr[idx] == '"' || in->ptr[idx] == '\'') + { + char tchar = in->ptr[idx]; + /* copy entire names through quickly */ + sb_add_char (out, in->ptr[idx]); + idx++; + while (idx < in->len && in->ptr[idx] != tchar) + { + sb_add_char (out, in->ptr[idx]); + idx++; + } + } else { /* nothing special, just pass it through */ diff --git a/gas/testsuite/gas/.Sanitize b/gas/testsuite/gas/.Sanitize index af678de0894..d05ec005154 100644 --- a/gas/testsuite/gas/.Sanitize +++ b/gas/testsuite/gas/.Sanitize @@ -34,6 +34,7 @@ Things-to-keep: all alpha arm +gasp h8300 hppa i386 diff --git a/gas/testsuite/gas/gasp/.Sanitize b/gas/testsuite/gas/gasp/.Sanitize new file mode 100644 index 00000000000..09f3cc951dd --- /dev/null +++ b/gas/testsuite/gas/gasp/.Sanitize @@ -0,0 +1,40 @@ +# Sanitize.in for devo. +# $Id$ +# + +# Each directory to survive it's way into a release will need a file +# like this one called "./.Sanitize". All keyword lines must exist, +# and must exist in the order specified by this file. Each directory +# in the tree will be processed, top down, in the following order. + +# Hash started lines like this one are comments and will be deleted +# before anything else is done. Blank lines will also be squashed +# out. + +# The lines between the "Do-first:" line and the "Things-to-keep:" +# line are executed as a /bin/sh shell script before anything else is +# done in this + +Do-first: + + +# All files listed between the "Things-to-keep:" line and the +# "Files-to-sed:" line will be kept. All other files will be removed. +# Directories listed in this section will have their own Sanitize +# called. Directories not listed will be removed in their entirety +# with rm -rf. + +Things-to-keep: + +assign.asm +assign.err +assign.out +gasp.exp +pr7583.asm +pr7583.out + +Things-to-lose: + +Do-last: + +# End of file. diff --git a/gas/testsuite/gas/gasp/assign.asm b/gas/testsuite/gas/gasp/assign.asm new file mode 100644 index 00000000000..7f66718468d --- /dev/null +++ b/gas/testsuite/gas/gasp/assign.asm @@ -0,0 +1,13 @@ + +foo: .ASSIGNC "hello" +BAR: .ASSIGNA 12+34 + + \&foo'foo + \&foo\&foo\&foo + \&foo \&foo \&foo + \&BAR\&bar\&BAR + + + + + .END diff --git a/gas/testsuite/gas/gasp/assign.err b/gas/testsuite/gas/gasp/assign.err new file mode 100644 index 00000000000..fe3733f7eab --- /dev/null +++ b/gas/testsuite/gas/gasp/assign.err @@ -0,0 +1 @@ +assign.asm:8 Can't find preprocessor variable bar. diff --git a/gas/testsuite/gas/gasp/assign.out b/gas/testsuite/gas/gasp/assign.out new file mode 100644 index 00000000000..85509ae614f --- /dev/null +++ b/gas/testsuite/gas/gasp/assign.out @@ -0,0 +1,22 @@ +! + +!foo: .ASSIGNC "hello" +!BAR: .ASSIGNA 12+34 +! + +! \&foo'foo + hellofoo +! \&foo\&foo\&foo + hellohellohello +! \&foo \&foo \&foo + hello hello hello +! \&BAR\&bar\&BAR + 4646 +! + +! + +! + +! +! .END diff --git a/gas/testsuite/gas/gasp/gasp.exp b/gas/testsuite/gas/gasp/gasp.exp new file mode 100644 index 00000000000..26dba011532 --- /dev/null +++ b/gas/testsuite/gas/gasp/gasp.exp @@ -0,0 +1,33 @@ + +proc gasp_test { testname } { + global GASP + global srcdir + + send_log "$srcdir/lib/run $GASP -s $testname.asm -o gasp.out \n" + catch "exec $srcdir/lib/run $GASP -s $testname.asm -o gasp.out" errs + catch "exec diff gasp.out $testname.out" diffs + if ![string match "" $diffs] { + send_log "$diffs\n" + verbose $diffs + fail $testname + send_log "exec cat gasp.out" + return 0 + } else { + pass $testname + } + +} + + + +foreach src [ lsort [ glob $srcdir/gas/gasp/*.asm ] ] { + regsub -all ".asm" $src "" t + gasp_test $t +} + + +# FIXME: this is here cause of a bug in DejaGnu 1.1.1. When it is no longer +# in use, then this can be removed. +if [info exists errorInfo] then { + unset errorInfo +} diff --git a/gas/testsuite/gas/gasp/pr7583.asm b/gas/testsuite/gas/gasp/pr7583.asm new file mode 100644 index 00000000000..c97caf546db --- /dev/null +++ b/gas/testsuite/gas/gasp/pr7583.asm @@ -0,0 +1,3 @@ + + .sdata "v1.0000" + .end diff --git a/gas/testsuite/gas/gasp/pr7583.out b/gas/testsuite/gas/gasp/pr7583.out new file mode 100644 index 00000000000..a5df1d7f58d --- /dev/null +++ b/gas/testsuite/gas/gasp/pr7583.out @@ -0,0 +1,5 @@ +! + +! .sdata "v1.0000" + .byte 118,49,46,48,48,48,48 +! .end -- 2.30.2