mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-25 11:04:18 +08:00
Reorganized test hierarchy to categorize tests.
New test procs support examining listing output from assembler. New tests added.
This commit is contained in:
parent
0b81fc4394
commit
6bf74aa6ca
@ -24,6 +24,8 @@ Do-first:
|
||||
# called. Directories not listed will be removed in their entirety
|
||||
# with rm -rf.
|
||||
|
||||
# The entire "gas.confidential" directory should get deleted.
|
||||
|
||||
Things-to-keep:
|
||||
|
||||
ChangeLog
|
||||
|
@ -76,6 +76,8 @@ site.exp: ./Makefile
|
||||
@echo "set target_alias ${target_alias}" >> ./tmp0
|
||||
@echo "set target_cpu ${target_cpu}" >> ./tmp0
|
||||
@echo "set target_vendor ${target_vendor}" >> ./tmp0
|
||||
@echo "set host_triplet ${host_canonical}" >> ./tmp0
|
||||
@echo "set target_triplet ${target_canonical}" >> ./tmp0
|
||||
@echo "set target_canonical ${target_canonical}" >> ./tmp0
|
||||
@echo "set srcdir ${srcdir}" >> ./tmp0
|
||||
@echo "set exec_prefix ${exec_prefix}" >> ./tmp0
|
||||
@ -87,7 +89,7 @@ site.exp: ./Makefile
|
||||
@rm -f ./tmp1 ./tmp0
|
||||
|
||||
check: site.exp
|
||||
$(RUNTEST) $(RUNTESTFLAGS) --tool gas AS=$(AS_FOR_TARGET)
|
||||
$(RUNTEST) $(RUNTESTFLAGS) --tool gas AS=$(AS_FOR_TARGET) ASFLAGS=
|
||||
|
||||
force:
|
||||
|
||||
|
@ -1 +1,3 @@
|
||||
load_lib gas-defs.exp
|
||||
|
||||
gas_init
|
||||
|
@ -24,21 +24,16 @@ Do-first:
|
||||
# called. Directories not listed will be removed in their entirety
|
||||
# with rm -rf.
|
||||
|
||||
# Currently, p2411.s and p2425a.s should be sanitized away.
|
||||
# All else should stay.
|
||||
|
||||
Things-to-keep:
|
||||
|
||||
gas.exp
|
||||
p2389.s
|
||||
p2389a.s
|
||||
p2425.s
|
||||
p2430.s
|
||||
p2430a.s
|
||||
sol-cc.s
|
||||
sol-gcc.s
|
||||
t1.s
|
||||
t2.s
|
||||
all
|
||||
i386-bsd
|
||||
ieee.fp
|
||||
m68k
|
||||
m68k-coff
|
||||
sparc
|
||||
sparc-solaris
|
||||
template
|
||||
|
||||
Do-last:
|
||||
|
||||
|
36
gas/testsuite/gas/all/.Sanitize
Normal file
36
gas/testsuite/gas/all/.Sanitize
Normal 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
|
||||
comment.s
|
||||
p2425.s
|
||||
x930509.s
|
||||
|
||||
Do-last:
|
||||
|
||||
# End of file.
|
3
gas/testsuite/gas/all/comment.s
Normal file
3
gas/testsuite/gas/all/comment.s
Normal file
@ -0,0 +1,3 @@
|
||||
# This test file is to see whether comments get written into listings
|
||||
# correctly. The file has no real contents.
|
||||
/* C comments too! */
|
3
gas/testsuite/gas/all/x930509.s
Normal file
3
gas/testsuite/gas/all/x930509.s
Normal file
@ -0,0 +1,3 @@
|
||||
.long L1-L2
|
||||
L1: .long 0x1234
|
||||
L2: .long 0x5678
|
@ -1,65 +0,0 @@
|
||||
# syntax:
|
||||
#
|
||||
# gas_test_stdout args regexp testname
|
||||
# looks for regexp on stdout
|
||||
#
|
||||
# gas_test args testname
|
||||
# just checks that exit status is zero
|
||||
#
|
||||
|
||||
gas_init
|
||||
|
||||
# List of optional assembler options that are likely to alter the assembler's
|
||||
# behavior. Keep this set small, since its power set generates the list of
|
||||
# test cases run. Suggested: listings (shouldn't affect outcome drastically
|
||||
# but does), pic?, ...
|
||||
set stdoptlist "-a>"
|
||||
|
||||
#
|
||||
# Target-independent tests
|
||||
#
|
||||
|
||||
gas_test "p2425.s" "" $stdoptlist "pcrel values in assignment"
|
||||
|
||||
#
|
||||
# Some m68k-coff tests
|
||||
#
|
||||
if [istarget m68*-*-coff] then {
|
||||
gas_test "p2430.s" "" $stdoptlist "local branch not in text section"
|
||||
|
||||
gas_test "p2430a.s" "" $stdoptlist "local branch not in text section"
|
||||
|
||||
gas_test "t1.s" "" $stdoptlist "multiple .file directives"
|
||||
|
||||
gas_test "p2389.s" "" $stdoptlist "bss fill"
|
||||
gas_test_error "p2389a.s" "" "detect bss fill with non-zero data"
|
||||
|
||||
if [file exists "$testdir/p2411.s"] then {
|
||||
gas_test "p2411.s" "" $stdoptlist "PR 2411"
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Some generic m68k tests
|
||||
#
|
||||
if [istarget m68*-*-*] then {
|
||||
#
|
||||
# Operand size dependent on offset computed using operand size
|
||||
#
|
||||
if [file exists "$testdir/p2425a.s"] then {
|
||||
gas_test "p2425a.s" "" $stdoptlist "PR 2425"
|
||||
}
|
||||
|
||||
gas_test "t2.s" "" $stdoptlist "cross-section branch"
|
||||
}
|
||||
|
||||
#
|
||||
# Solaris-2 on SPARC tests
|
||||
#
|
||||
# The two compilers, cc and gcc, generate quite different debugging
|
||||
# records. Verify that we can accept both.
|
||||
#
|
||||
if [istarget sparc-*-solaris2*] then {
|
||||
gas_test "sol-cc.s" "" $stdoptlist "SPARC Solaris cc -g"
|
||||
gas_test "sol-gcc.s" "" $stdoptlist "SPARC Solaris gcc -g"
|
||||
}
|
34
gas/testsuite/gas/ieee.fp/.Sanitize
Normal file
34
gas/testsuite/gas/ieee.fp/.Sanitize
Normal file
@ -0,0 +1,34 @@
|
||||
# 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:
|
||||
|
||||
x930509a.exp
|
||||
x930509a.s
|
||||
|
||||
Do-last:
|
||||
|
||||
# End of file.
|
21
gas/testsuite/gas/ieee.fp/x930509a.exp
Normal file
21
gas/testsuite/gas/ieee.fp/x930509a.exp
Normal file
@ -0,0 +1,21 @@
|
||||
# Reported 93/05/09 by Jim Wilson: IEEE single-precision FLT_MIN value gets
|
||||
# assembled incorrectly. (Off by one ulp.)
|
||||
|
||||
proc dotest {} {
|
||||
set testname "IEEE FLT_MIN, single-precision"
|
||||
set x 0
|
||||
gas_start "x930509a.s" "-al"
|
||||
while 1 {
|
||||
expect {
|
||||
-re " 00008000 +.single" { pass $testname; set x 1 }
|
||||
-re " ........ +.single" { fail $testname; set x 1 }
|
||||
-re "\[^\n\]*\n" { }
|
||||
timeout { error "timeout\n"; break }
|
||||
eof { break }
|
||||
}
|
||||
}
|
||||
gas_finish
|
||||
if !$x then { fail "$testname (listing didn't match)" }
|
||||
}
|
||||
|
||||
dotest
|
5
gas/testsuite/gas/ieee.fp/x930509a.s
Normal file
5
gas/testsuite/gas/ieee.fp/x930509a.s
Normal file
@ -0,0 +1,5 @@
|
||||
.global _flt_min
|
||||
.data
|
||||
.align 4
|
||||
_flt_min:
|
||||
.single 0r1.17549435e-38
|
38
gas/testsuite/gas/m68k-coff/.Sanitize
Normal file
38
gas/testsuite/gas/m68k-coff/.Sanitize
Normal file
@ -0,0 +1,38 @@
|
||||
# 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
|
||||
p2389.s
|
||||
p2389a.s
|
||||
p2430.s
|
||||
p2430a.s
|
||||
t1.s
|
||||
|
||||
Do-last:
|
||||
|
||||
# End of file.
|
14
gas/testsuite/gas/m68k-coff/gas.exp
Normal file
14
gas/testsuite/gas/m68k-coff/gas.exp
Normal file
@ -0,0 +1,14 @@
|
||||
#
|
||||
# Some m68k-coff tests
|
||||
#
|
||||
if [istarget m68*-*-coff] then {
|
||||
gas_test "p2430.s" "" $stdoptlist "local branch not in text section"
|
||||
|
||||
gas_test "p2430a.s" "" $stdoptlist "local branch not in text section"
|
||||
|
||||
gas_test "t1.s" "" $stdoptlist "multiple .file directives"
|
||||
|
||||
gas_test "p2389.s" "" $stdoptlist "bss fill"
|
||||
gas_test_error "p2389a.s" "" "detect bss fill with non-zero data"
|
||||
|
||||
}
|
35
gas/testsuite/gas/m68k/.Sanitize
Normal file
35
gas/testsuite/gas/m68k/.Sanitize
Normal file
@ -0,0 +1,35 @@
|
||||
# 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:
|
||||
|
||||
all.exp
|
||||
p2663.s
|
||||
t2.s
|
||||
|
||||
Do-last:
|
||||
|
||||
# End of file.
|
16
gas/testsuite/gas/m68k/p2663.s
Normal file
16
gas/testsuite/gas/m68k/p2663.s
Normal file
@ -0,0 +1,16 @@
|
||||
|
|
||||
| This code generates an incorrect pc relative offset
|
||||
|
|
||||
bug: movel #4,%d7
|
||||
jsr table(%pc,%d7.w) | wrong
|
||||
jsr %pc@(table-.-2:b,%d7:w) | correct but cryptic
|
||||
nop
|
||||
nop
|
||||
table:
|
||||
bra junk
|
||||
bra junk
|
||||
bra junk
|
||||
|
||||
junk:
|
||||
nop
|
||||
rts
|
@ -1,72 +0,0 @@
|
||||
WORDSIZE=4
|
||||
|
||||
.text
|
||||
.globl _doworm
|
||||
|
||||
_doworm:
|
||||
moveml %a2-%a4,%sp@-
|
||||
movl _memsize,%d0
|
||||
subl #CODESIZE,%d0
|
||||
addl #0x0,%d0
|
||||
movl %d0,%a3
|
||||
movl %a3,%a4
|
||||
addl #WORMSIZE,%a4
|
||||
movl #CODESIZE,%sp@-
|
||||
movl %a3,%sp@-
|
||||
movl #worm,%sp@-
|
||||
jsr _bcopy
|
||||
addl #12,%sp
|
||||
movl %a4,%a0
|
||||
subl #WORDSIZE,%a0
|
||||
movl %sp@(16),%a0@
|
||||
jsr %a3@
|
||||
moveml %sp@+,%a2-%a4
|
||||
rts
|
||||
|
||||
|
||||
worm:
|
||||
jsr _t_disable
|
||||
movl #LONGWORMSIZE,%d0
|
||||
movl %a3,%a0
|
||||
movl #worm,%a2
|
||||
lea %a3@(-WORDSIZE),%a1
|
||||
crawl:
|
||||
movl %a0@+,%a1@
|
||||
cmpml %a1@+,%a2@+
|
||||
dbne %d0,crawl
|
||||
jsr _t_enable
|
||||
subl #WORDSIZE,%a3
|
||||
jmp %a4@
|
||||
nop
|
||||
.long 0
|
||||
WORMSIZE=.-worm
|
||||
LONGWORMSIZE=WORMSIZE/4
|
||||
|
||||
|
||||
manager:
|
||||
tstw %d0
|
||||
bgt manerr
|
||||
cmpl _baseaddr,%a3
|
||||
beq manfin
|
||||
jmp %a3@
|
||||
manerr:
|
||||
cmpw #1,_noiselevel
|
||||
blt manerr1
|
||||
movl %a1,%d1
|
||||
subl #4,%d1
|
||||
movl %d1,%sp@-
|
||||
movl %d0,%sp@-
|
||||
pea errmsg
|
||||
jsr _printf
|
||||
addl #12,%sp
|
||||
manerr1:
|
||||
moveq #0,%d0
|
||||
bra manret
|
||||
manfin:
|
||||
moveq #1,%d0
|
||||
manret:
|
||||
rts
|
||||
nop
|
||||
CODESIZE=.-worm
|
||||
|
||||
errmsg: .asciz " Premature termination (%d) at %#x"
|
35
gas/testsuite/gas/sparc-solaris/.Sanitize
Normal file
35
gas/testsuite/gas/sparc-solaris/.Sanitize
Normal file
@ -0,0 +1,35 @@
|
||||
# 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
|
||||
sol-cc.s
|
||||
sol-gcc.s
|
||||
|
||||
Do-last:
|
||||
|
||||
# End of file.
|
10
gas/testsuite/gas/sparc-solaris/gas.exp
Normal file
10
gas/testsuite/gas/sparc-solaris/gas.exp
Normal file
@ -0,0 +1,10 @@
|
||||
#
|
||||
# Solaris-2 on SPARC tests
|
||||
#
|
||||
# The two compilers, cc and gcc, generate quite different debugging
|
||||
# records. Verify that we can accept both.
|
||||
#
|
||||
if [istarget sparc-*-solaris2*] then {
|
||||
gas_test "sol-cc.s" "" $stdoptlist "SPARC Solaris cc -g"
|
||||
gas_test "sol-gcc.s" "" $stdoptlist "SPARC Solaris gcc -g"
|
||||
}
|
96
gas/testsuite/gas/template
Normal file
96
gas/testsuite/gas/template
Normal file
@ -0,0 +1,96 @@
|
||||
#
|
||||
# This is sort of a prototype test case, which parses the listing output
|
||||
# from the assembler. Later, more prototypes should be added for cases
|
||||
# where objdump gets run over the .o file, and anything else like that...
|
||||
#
|
||||
# When you write a test case that uses the listing output, just copy this
|
||||
# file (trimming down the overly-verbose comments a little), and
|
||||
# adjust it to do what you need.
|
||||
#
|
||||
# Remember that any ".exp" file found in the tree will be processed by
|
||||
# dejagnu.
|
||||
|
||||
#
|
||||
# FIRST SAMPLE TEST CASE
|
||||
#
|
||||
|
||||
proc do_foo {} {
|
||||
# This string is used below when printing out a success or failure message.
|
||||
# If more than one test is run by a given .exp file, it'd be nice to include
|
||||
# the name of the input file.
|
||||
set testname "foo.s: multi-register tweaking and frobnication"
|
||||
|
||||
# I use this as a flag to record whether the test case passed. If this
|
||||
# flag is still clear when EOF is reached, this test fails. If there are
|
||||
# two or more patterns, and I need to see all of them, I'll create N variables
|
||||
# and check if the sum is N.
|
||||
set x 0
|
||||
|
||||
# Call gas_start with two arguments: The input file name (which it'll search
|
||||
# for in $srcdir/$subdir, that is, the source directory where the .exp file
|
||||
# is), and a (possibly empty) string of options to pass to the assembler.
|
||||
gas_start "foo.s" "-al"
|
||||
|
||||
# Now I just iterate over all the output lines, looking for what I want
|
||||
# to see. Since each pattern explicitly will not span line breaks, there's
|
||||
# also a pattern for lines that don't match anything else. (Is it safe to
|
||||
# use ".*" for patterns not crossing line breaks? I don't think "$" does the
|
||||
# right thing for that, in any case. I should check into whether the extra
|
||||
# pattern is even needed.
|
||||
|
||||
# Apparently CRLF is received when using ptys for subprocesses; hence the
|
||||
# \r\n for matching line number 3.
|
||||
|
||||
# Note that if you use "{ ... }" for the expect clause, you can't have
|
||||
# comments inside it.
|
||||
|
||||
# This test case is kinda bogus in that seeing either a word of all zeros
|
||||
# at address zero or a C-style comment on line three that says "Looking for
|
||||
# C comments" (with very specific punctuation and whitespace) will cause
|
||||
# it to pass this test. Usually
|
||||
while 1 {
|
||||
expect {
|
||||
-re "^ +\[0-9\]+ 0000 00000000\[^\n\]*\n" { set x 1 }
|
||||
-re "^ +3\[ \t\]+/. Looking for C comments. ./\r\n" { set x 1 }
|
||||
-re "\[^\n\]*\n" { }
|
||||
timeout { error "timeout\n"; break }
|
||||
eof { break }
|
||||
}
|
||||
}
|
||||
# This was intended to do any cleanup necessary. It kinda looks like it isn't
|
||||
# needed, but just in case, please keep it in for now.
|
||||
gas_finish
|
||||
|
||||
# Did we find what we were looking for? If not, flunk it.
|
||||
if $x then { pass $testname } else { fail $testname }
|
||||
}
|
||||
|
||||
# Now actually run the test. It can be conditionalized if the test is
|
||||
# not appropriate for all targets. The proc "istarget" checks a generalized
|
||||
# form of the target name, so that (e.g.) "m68332-unknown-aout" would match
|
||||
# here. So far, I think only the CPU name is actually ever altered.
|
||||
if [istarget m68k-*] then {
|
||||
do_foo
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#
|
||||
# SECOND SAMPLE TEST CASE
|
||||
#
|
||||
|
||||
# This is a tiny bit like the C compiler torture tests, in that it'll run
|
||||
# the assembler with the power set of the list of options supplied.
|
||||
#
|
||||
# The first argument is the test file name; the second is arguments that
|
||||
# are always to be provided; the third is a space-separated list of options
|
||||
# which are optional (ending in ">" if output should be ignored, like "-a>");
|
||||
# the fourth is the name of the test. So far, only binary options are handled
|
||||
# this way; N-way options (like CPU type for m68k) aren't handled yet.
|
||||
#
|
||||
# The variable $stdoptlist usually has a reasonable set of optional options
|
||||
# for this target.
|
||||
|
||||
# No, PIC isn't supported yet. This is only an example.
|
||||
gas_test "quux.s" "-K" $stdoptlist "use of quuxes in PIC mode"
|
Loading…
Reference in New Issue
Block a user