First crack at a test suite.

This commit is contained in:
Ken Raeburn 1993-03-29 13:27:13 +00:00
parent de001789f9
commit f70a4714c9
14 changed files with 430 additions and 9 deletions

View File

@ -85,6 +85,7 @@ symbols.c
symbols.h
tc.h
testscripts
testsuite
version.c
write.c
write.h
@ -107,7 +108,10 @@ fi
#
#
# $Log$
# Revision 1.15 1993/02/13 10:12:16 zoo
# Revision 1.16 1993/03/29 13:26:44 raeburn
# First crack at a test suite.
#
# Revision 1.15 1993/02/13 10:12:16 zoo
# removing excess verbosity
#
# Revision 1.14 1993/01/08 14:40:59 raeburn

View File

@ -30,7 +30,7 @@
srctrigger=as.c
srcname="gas"
need_bfd=no
configdirs=doc
configdirs="doc testsuite"
# per-host:
@ -45,9 +45,9 @@ case "${host}" in
esac
;;
mips-dec-ultrix)
gas_host=decstation
gas_host=decstatn
;;
mips-*-bsd)
mips-*-bsd*)
gas_host=mipsbsd
;;
i[34]86-ibm-aix*)
@ -101,12 +101,15 @@ case ${target_cpu} in
sparc64) cpu_type=sparc obj_format=aout ;;
m680[01234]0) cpu_type=m68k ;;
m683??) cpu_type=m68k ;;
i486) cpu_type=i386 ;;
esac
gas_target=${cpu_type}
generic_target=${cpu_type}-${target_vendor}-${target_os}
# assign object format
case ${target} in
case ${generic_target} in
a29k-amd-udi)
obj_format=coffbfd
need_bfd=yes
@ -122,21 +125,21 @@ case ${target} in
need_bfd=yes
gas_target=ebmon29k
;;
i[34]86-ibm-aix*)
i386-ibm-aix*)
obj_format=coffbfd
need_bfd=yes
gas_target=i386coff
emulation=i386aix
;;
i[34]86-*-bsd*)
i386-*-bsd*)
obj_format=aout
;;
i[34]86-*-coff | i[34]86-*-sysv* | i[34]86-*-sco* | i[34]86-*-isc*)
i386-*-coff | i386-*-sysv* | i386-*-sco* | i386-*-isc*)
obj_format=coffbfd
need_bfd=yes
gas_target=i386coff
;;
i[34]86-*-go32)
i386-*-go32)
obj_format=aout
;;
i960-wrs-vxworks)

37
gas/testsuite/.Sanitize Normal file
View File

@ -0,0 +1,37 @@
# 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:
Makefile.in
config
configure.in
gas
lib
Do-last:
# End of file.

104
gas/testsuite/Makefile.in Normal file
View File

@ -0,0 +1,104 @@
srcdir = .
prefix = /usr/local
exec_prefix = $(prefix)
bindir = $(exec_prefix)/bin
libdir = $(exec_prefix)/lib
tooldir = $(libdir)/$(target_alias)
datadir = $(exec_prefix)/lib/deja-gnu
mandir = $(prefix)/man
man1dir = $(mandir)/man1
man2dir = $(mandir)/man2
man3dir = $(mandir)/man3
man4dir = $(mandir)/man4
man5dir = $(mandir)/man5
man6dir = $(mandir)/man6
man7dir = $(mandir)/man7
man8dir = $(mandir)/man8
man9dir = $(mandir)/man9
infodir = $(prefix)/info
includedir = $(prefix)/include
gxx_includedir = $(tooldir)/g++-include
docdir = $(datadir)/doc
targetdir = $(datadir)/$(target_alias)
SHELL = /bin/sh
INSTALL = install -c
INSTALL_PROGRAM = $(INSTALL)
INSTALL_DATA = $(INSTALL)
GCC = gcc
GCCFLAGS = -g -O
LINK= ln -s
RUNTEST = runtest
RUNTESTFLAGS =
# The ugliness in the program_transform_name version seems necessary
# to work around some strange behavior of /bin/sh on 386bsd (0.1).
AS_FOR_TARGET = ` \
if [ -f ../Makefile ] ; then \
echo ../as.new ; \
else \
if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
echo $(AS); \
else \
(set -e ; t='$(program_transform_name)'; echo as | sed -e '' $$t); \
fi; \
fi`
#### host, target, and site specific Makefile frags come in here.
all:
.NOEXPORT:
install:
uninstall: force
site.exp: ./Makefile
@echo "Making a new config file..."
-@rm -f ./tmp?
@touch site.exp
-@mv site.exp site.bak
@echo "## these variables are automatically generated by make ##" > ./tmp0
@echo "# Do not edit here. If you wish to override these values" >> ./tmp0
@echo "# add them to the last section" >> ./tmp0
@echo "set host_os ${host_os}" >> ./tmp0
@echo "set host_alias ${host_alias}" >> ./tmp0
@echo "set host_cpu ${host_cpu}" >> ./tmp0
@echo "set host_vendor ${host_vendor}" >> ./tmp0
@echo "set target_os ${target_os}" >> ./tmp0
@echo "set target_alias ${target_alias}" >> ./tmp0
@echo "set target_cpu ${target_cpu}" >> ./tmp0
@echo "set target_vendor ${target_vendor}" >> ./tmp0
@echo "set target_canonical ${target_canonical}" >> ./tmp0
@echo "set srcdir ${srcdir}" >> ./tmp0
@echo "set exec_prefix ${exec_prefix}" >> ./tmp0
@echo "set objdir `pwd`" >> ./tmp0
@echo "## All variables above are generated by configure. Do Not Edit ##" >> ./tmp0
@cat ./tmp0 > site.exp
@cat site.bak | sed \
-e '1,/^## All variables above are.*##/ d' >> site.exp
@rm -f ./tmp1 ./tmp0
check: site.exp
$(RUNTEST) $(RUNTESTFLAGS) --tool gas AS=$(AS_FOR_TARGET)
force:
clean:
-rm -f *~ core *.o a.out xgdb *.x a.out b.out
distclean: clean
-rm -f *~ core
-rm -f Makefile config.status
-rm -fr *.log summary detail
Makefile : $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
$(SHELL) ./config.status

View File

@ -0,0 +1,33 @@
# 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:
unix-gas.exp
Do-last:
# End of file.

View File

@ -0,0 +1 @@
load_lib gas-defs.exp

View File

@ -0,0 +1,18 @@
# This file is a shell script fragment that supplies the information
# necessary to tailor a template configure script into the configure
# script appropriate for this directory. For more information, check
# any existing configure script.
srctrigger=Makefile.in
srcname="DejaGnu"
# per-host:
# per-target:
# All the tests are run on the host, which we're assuming is unix.
# But it looks like dejagnu wants `where the tests are run' to be
# in target_abbrev.
target_abbrev=unix
# post-target:

View File

@ -0,0 +1,36 @@
# 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:
gas.exp
p2425.s
p2430.s
t1.s
Do-last:
# End of file.

38
gas/testsuite/gas/gas.exp Normal file
View File

@ -0,0 +1,38 @@
# syntax:
#
# gas_test_stdout args regexp testname
# looks for regexp on stdout
#
# gas_test args testname
# just checks that exit status is zero
#
set testdir $srcdir/gas
#
# Test empty file, and version number
#
#gas_test_stdout "" "GNU assembler version .* (.*)"
#
# Target-independent tests
#
gas_test "$testdir/p2425.s" "pcrel values in assignment"
gas_test "-al $testdir/p2425.s" "pcrel values in assignment, with listing"
#
# Some m68k-coff tests
#
if [istarget m68k-*-coff] then {
#
# Local branch in non-text section
#
gas_test "$testdir/p2430.s" "local branch not in text section"
#
# Multiple (implicit) .file directives
#
gas_test "$testdir/t1.s" "multiple .file directives"
}

View File

@ -0,0 +1,6 @@
.text
.globl _frobnitz
_frobnitz:
.long 1, 2, 3, 4, 5, 6, 7, GRUMP, 42
GRUMP=.-_frobnitz
HALFGRUMP=GRUMP/2

View File

@ -0,0 +1,3 @@
.sect foo
tag:
bra tag

36
gas/testsuite/gas/t1.s Normal file
View File

@ -0,0 +1,36 @@
# 1 "libgcc1.S"
# 42 "libxyz1.S"
# 259 "libgcc1.S"
.text
.proc
|#PROC# 04
.globl __mulsi3
__mulsi3 :
|#PROLOGUE# 0
link %a6 ,#0
addl #-LF14, %sp
moveml #LS14, %sp @
|#PROLOGUE# 1
movew %a6 @(0x8), %d0
muluw %a6 @(0xe), %d0
movew %a6 @(0xa), %d1
muluw %a6 @(0xc), %d1
addw %d1 , %d0
lsll #8, %d0
lsll #8, %d0
movew %a6 @(0xa), %d1
muluw %a6 @(0xe), %d1
addl %d1 , %d0
jra LE14
LE14:
|#PROLOGUE# 2
moveml %sp @, #LS14
unlk %a6
|#PROLOGUE# 3
rts
LF14 = 4
LS14 = 0x0002
LFF14 = 0
# 354 "libgcc1.S"
LSS14 = 0x0
LV14 = 0

View File

@ -0,0 +1,33 @@
# 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:
gas-defs.exp
Do-last:
# End of file.

View File

@ -0,0 +1,69 @@
# Copyright (C) 1993 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
# Please email any bugs, comments, and/or additions to this file to:
# DejaGnu@cygnus.com
# This file was written by Ken Raeburn (raeburn@cygnus.com).
proc gas_version {} {
global AS
set tmp [exec $AS -version < /dev/null]
# Should find a way to discard constant parts, keep whatever's
# left, so the version string could be almost anything at all...
regexp " \[0-9\]\[0-9\.a-zA-Z-\]+" $tmp version
set tmp $version
regexp "\[0-9\.a-zA-Z-\]+" $tmp version
clone_output "[which $AS] version $version\n"
unset tmp
unset version
}
proc gas_start { prog } {
global verbose
global AS
global ASFLAGS
global comp_output
if $verbose>1 then {
send_user "Executing $AS $ASFLAGS $prog\n"
}
catch "exec $AS $ASFLAGS $prog" comp_output
if ![string match "" $comp_output] then {
send_log "$comp_output\n"
if $verbose>1 then {
send_user "$comp_output\n"
}
}
}
proc gas_test { arg testname } {
global verbose
global comp_output
gas_start $arg
if ![string match "" $comp_output] then {
send_log "$comp_output\n"
if $verbose>3 then {
send_user "|$comp_output|\n"
}
}
if [string match "" $comp_output] then {
pass "$testname"
} else {
fail "$testname"
}
}