From 6bf74aa6ca60815497b24ce767935c53cb89c9aa Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Mon, 10 May 1993 18:58:50 +0000 Subject: [PATCH] Reorganized test hierarchy to categorize tests. New test procs support examining listing output from assembler. New tests added. --- gas/testsuite/.Sanitize | 2 + gas/testsuite/Makefile.in | 4 +- gas/testsuite/config/unix-gas.exp | 2 + gas/testsuite/gas/.Sanitize | 21 ++-- gas/testsuite/gas/all/.Sanitize | 36 +++++++ gas/testsuite/gas/all/comment.s | 3 + gas/testsuite/gas/{ => all}/p2425.s | 0 gas/testsuite/gas/all/x930509.s | 3 + gas/testsuite/gas/gas.exp | 65 ------------- gas/testsuite/gas/ieee.fp/.Sanitize | 34 +++++++ gas/testsuite/gas/ieee.fp/x930509a.exp | 21 ++++ gas/testsuite/gas/ieee.fp/x930509a.s | 5 + gas/testsuite/gas/m68k-coff/.Sanitize | 38 ++++++++ .../gas/{ => m68k-coff/confidential}/p2411.s | 0 gas/testsuite/gas/m68k-coff/gas.exp | 14 +++ gas/testsuite/gas/{ => m68k-coff}/p2389.s | 0 gas/testsuite/gas/{ => m68k-coff}/p2389a.s | 0 gas/testsuite/gas/{ => m68k-coff}/p2430.s | 0 gas/testsuite/gas/{ => m68k-coff}/p2430a.s | 0 gas/testsuite/gas/{ => m68k-coff}/t1.s | 0 gas/testsuite/gas/m68k/.Sanitize | 35 +++++++ gas/testsuite/gas/m68k/p2663.s | 16 ++++ gas/testsuite/gas/{ => m68k}/t2.s | 0 gas/testsuite/gas/p2425a.s | 72 -------------- gas/testsuite/gas/sparc-solaris/.Sanitize | 35 +++++++ gas/testsuite/gas/sparc-solaris/gas.exp | 10 ++ .../gas/{ => sparc-solaris}/sol-cc.s | 0 .../gas/{ => sparc-solaris}/sol-gcc.s | 0 gas/testsuite/gas/template | 96 +++++++++++++++++++ 29 files changed, 361 insertions(+), 151 deletions(-) create mode 100644 gas/testsuite/gas/all/.Sanitize create mode 100644 gas/testsuite/gas/all/comment.s rename gas/testsuite/gas/{ => all}/p2425.s (100%) create mode 100644 gas/testsuite/gas/all/x930509.s delete mode 100644 gas/testsuite/gas/gas.exp create mode 100644 gas/testsuite/gas/ieee.fp/.Sanitize create mode 100644 gas/testsuite/gas/ieee.fp/x930509a.exp create mode 100644 gas/testsuite/gas/ieee.fp/x930509a.s create mode 100644 gas/testsuite/gas/m68k-coff/.Sanitize rename gas/testsuite/gas/{ => m68k-coff/confidential}/p2411.s (100%) create mode 100644 gas/testsuite/gas/m68k-coff/gas.exp rename gas/testsuite/gas/{ => m68k-coff}/p2389.s (100%) rename gas/testsuite/gas/{ => m68k-coff}/p2389a.s (100%) rename gas/testsuite/gas/{ => m68k-coff}/p2430.s (100%) rename gas/testsuite/gas/{ => m68k-coff}/p2430a.s (100%) rename gas/testsuite/gas/{ => m68k-coff}/t1.s (100%) create mode 100644 gas/testsuite/gas/m68k/.Sanitize create mode 100644 gas/testsuite/gas/m68k/p2663.s rename gas/testsuite/gas/{ => m68k}/t2.s (100%) delete mode 100644 gas/testsuite/gas/p2425a.s create mode 100644 gas/testsuite/gas/sparc-solaris/.Sanitize create mode 100644 gas/testsuite/gas/sparc-solaris/gas.exp rename gas/testsuite/gas/{ => sparc-solaris}/sol-cc.s (100%) rename gas/testsuite/gas/{ => sparc-solaris}/sol-gcc.s (100%) create mode 100644 gas/testsuite/gas/template diff --git a/gas/testsuite/.Sanitize b/gas/testsuite/.Sanitize index fe17f29a980..98f98a30482 100644 --- a/gas/testsuite/.Sanitize +++ b/gas/testsuite/.Sanitize @@ -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 diff --git a/gas/testsuite/Makefile.in b/gas/testsuite/Makefile.in index 8243c9a01b0..b1342531d25 100644 --- a/gas/testsuite/Makefile.in +++ b/gas/testsuite/Makefile.in @@ -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: diff --git a/gas/testsuite/config/unix-gas.exp b/gas/testsuite/config/unix-gas.exp index a3b7387efba..050c56b7620 100644 --- a/gas/testsuite/config/unix-gas.exp +++ b/gas/testsuite/config/unix-gas.exp @@ -1 +1,3 @@ load_lib gas-defs.exp + +gas_init diff --git a/gas/testsuite/gas/.Sanitize b/gas/testsuite/gas/.Sanitize index b52d97042d5..f6a7a2a68df 100644 --- a/gas/testsuite/gas/.Sanitize +++ b/gas/testsuite/gas/.Sanitize @@ -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: diff --git a/gas/testsuite/gas/all/.Sanitize b/gas/testsuite/gas/all/.Sanitize new file mode 100644 index 00000000000..98aa749c9dc --- /dev/null +++ b/gas/testsuite/gas/all/.Sanitize @@ -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. diff --git a/gas/testsuite/gas/all/comment.s b/gas/testsuite/gas/all/comment.s new file mode 100644 index 00000000000..76bc641a75c --- /dev/null +++ b/gas/testsuite/gas/all/comment.s @@ -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! */ diff --git a/gas/testsuite/gas/p2425.s b/gas/testsuite/gas/all/p2425.s similarity index 100% rename from gas/testsuite/gas/p2425.s rename to gas/testsuite/gas/all/p2425.s diff --git a/gas/testsuite/gas/all/x930509.s b/gas/testsuite/gas/all/x930509.s new file mode 100644 index 00000000000..6d04aa53ee7 --- /dev/null +++ b/gas/testsuite/gas/all/x930509.s @@ -0,0 +1,3 @@ + .long L1-L2 +L1: .long 0x1234 +L2: .long 0x5678 diff --git a/gas/testsuite/gas/gas.exp b/gas/testsuite/gas/gas.exp deleted file mode 100644 index 9816cc76e28..00000000000 --- a/gas/testsuite/gas/gas.exp +++ /dev/null @@ -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" -} diff --git a/gas/testsuite/gas/ieee.fp/.Sanitize b/gas/testsuite/gas/ieee.fp/.Sanitize new file mode 100644 index 00000000000..6dfe50e6756 --- /dev/null +++ b/gas/testsuite/gas/ieee.fp/.Sanitize @@ -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. diff --git a/gas/testsuite/gas/ieee.fp/x930509a.exp b/gas/testsuite/gas/ieee.fp/x930509a.exp new file mode 100644 index 00000000000..53b13b5e53a --- /dev/null +++ b/gas/testsuite/gas/ieee.fp/x930509a.exp @@ -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 diff --git a/gas/testsuite/gas/ieee.fp/x930509a.s b/gas/testsuite/gas/ieee.fp/x930509a.s new file mode 100644 index 00000000000..4a8d730f47f --- /dev/null +++ b/gas/testsuite/gas/ieee.fp/x930509a.s @@ -0,0 +1,5 @@ + .global _flt_min +.data + .align 4 +_flt_min: + .single 0r1.17549435e-38 diff --git a/gas/testsuite/gas/m68k-coff/.Sanitize b/gas/testsuite/gas/m68k-coff/.Sanitize new file mode 100644 index 00000000000..4ec325fbd85 --- /dev/null +++ b/gas/testsuite/gas/m68k-coff/.Sanitize @@ -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. diff --git a/gas/testsuite/gas/p2411.s b/gas/testsuite/gas/m68k-coff/confidential/p2411.s similarity index 100% rename from gas/testsuite/gas/p2411.s rename to gas/testsuite/gas/m68k-coff/confidential/p2411.s diff --git a/gas/testsuite/gas/m68k-coff/gas.exp b/gas/testsuite/gas/m68k-coff/gas.exp new file mode 100644 index 00000000000..aa069fa62f2 --- /dev/null +++ b/gas/testsuite/gas/m68k-coff/gas.exp @@ -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" + +} diff --git a/gas/testsuite/gas/p2389.s b/gas/testsuite/gas/m68k-coff/p2389.s similarity index 100% rename from gas/testsuite/gas/p2389.s rename to gas/testsuite/gas/m68k-coff/p2389.s diff --git a/gas/testsuite/gas/p2389a.s b/gas/testsuite/gas/m68k-coff/p2389a.s similarity index 100% rename from gas/testsuite/gas/p2389a.s rename to gas/testsuite/gas/m68k-coff/p2389a.s diff --git a/gas/testsuite/gas/p2430.s b/gas/testsuite/gas/m68k-coff/p2430.s similarity index 100% rename from gas/testsuite/gas/p2430.s rename to gas/testsuite/gas/m68k-coff/p2430.s diff --git a/gas/testsuite/gas/p2430a.s b/gas/testsuite/gas/m68k-coff/p2430a.s similarity index 100% rename from gas/testsuite/gas/p2430a.s rename to gas/testsuite/gas/m68k-coff/p2430a.s diff --git a/gas/testsuite/gas/t1.s b/gas/testsuite/gas/m68k-coff/t1.s similarity index 100% rename from gas/testsuite/gas/t1.s rename to gas/testsuite/gas/m68k-coff/t1.s diff --git a/gas/testsuite/gas/m68k/.Sanitize b/gas/testsuite/gas/m68k/.Sanitize new file mode 100644 index 00000000000..5d0fbc506e6 --- /dev/null +++ b/gas/testsuite/gas/m68k/.Sanitize @@ -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. diff --git a/gas/testsuite/gas/m68k/p2663.s b/gas/testsuite/gas/m68k/p2663.s new file mode 100644 index 00000000000..9f3650fb8aa --- /dev/null +++ b/gas/testsuite/gas/m68k/p2663.s @@ -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 diff --git a/gas/testsuite/gas/t2.s b/gas/testsuite/gas/m68k/t2.s similarity index 100% rename from gas/testsuite/gas/t2.s rename to gas/testsuite/gas/m68k/t2.s diff --git a/gas/testsuite/gas/p2425a.s b/gas/testsuite/gas/p2425a.s deleted file mode 100644 index 261c868e0c3..00000000000 --- a/gas/testsuite/gas/p2425a.s +++ /dev/null @@ -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" diff --git a/gas/testsuite/gas/sparc-solaris/.Sanitize b/gas/testsuite/gas/sparc-solaris/.Sanitize new file mode 100644 index 00000000000..3b4e44af1ef --- /dev/null +++ b/gas/testsuite/gas/sparc-solaris/.Sanitize @@ -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. diff --git a/gas/testsuite/gas/sparc-solaris/gas.exp b/gas/testsuite/gas/sparc-solaris/gas.exp new file mode 100644 index 00000000000..63af6917e98 --- /dev/null +++ b/gas/testsuite/gas/sparc-solaris/gas.exp @@ -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" +} diff --git a/gas/testsuite/gas/sol-cc.s b/gas/testsuite/gas/sparc-solaris/sol-cc.s similarity index 100% rename from gas/testsuite/gas/sol-cc.s rename to gas/testsuite/gas/sparc-solaris/sol-cc.s diff --git a/gas/testsuite/gas/sol-gcc.s b/gas/testsuite/gas/sparc-solaris/sol-gcc.s similarity index 100% rename from gas/testsuite/gas/sol-gcc.s rename to gas/testsuite/gas/sparc-solaris/sol-gcc.s diff --git a/gas/testsuite/gas/template b/gas/testsuite/gas/template new file mode 100644 index 00000000000..41c4dc957c3 --- /dev/null +++ b/gas/testsuite/gas/template @@ -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" -- 2.30.2