From: Ken Raeburn Date: Mon, 10 May 1993 18:58:50 +0000 (+0000) Subject: Reorganized test hierarchy to categorize tests. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6bf74aa6ca60815497b24ce767935c53cb89c9aa;p=binutils-gdb.git Reorganized test hierarchy to categorize tests. New test procs support examining listing output from assembler. New tests added. --- 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/all/p2425.s b/gas/testsuite/gas/all/p2425.s new file mode 100644 index 00000000000..c3476a46d05 --- /dev/null +++ b/gas/testsuite/gas/all/p2425.s @@ -0,0 +1,6 @@ + .text + .globl _frobnitz +_frobnitz: + .long 1, 2, 3, 4, 5, 6, 7, GRUMP, 42 +GRUMP=.-_frobnitz +HALFGRUMP=GRUMP/2 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/m68k-coff/confidential/p2411.s b/gas/testsuite/gas/m68k-coff/confidential/p2411.s new file mode 100644 index 00000000000..3e4f932de0b --- /dev/null +++ b/gas/testsuite/gas/m68k-coff/confidential/p2411.s @@ -0,0 +1,14 @@ +# The assembler is failing with error 'FATAL:failed sanity check', giving +# the line of the 'dbf' instruction as the offending line. +# +# This will assemble ok if the section is '.text'. However we must +# be able to use a different section name. +# +# Our only workaround is to recode all of our loops to not use dbf. + + + .sect other + + loop1: + move.l %d1,%a0@+ + dbf %d0,loop1 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/m68k-coff/p2389.s b/gas/testsuite/gas/m68k-coff/p2389.s new file mode 100644 index 00000000000..3fa93e9b478 --- /dev/null +++ b/gas/testsuite/gas/m68k-coff/p2389.s @@ -0,0 +1,19 @@ +# I reached a point where the file looks +# clean and complies with gas syntax, but it core dumps gas. Here's a +# little gdb info: +# +# Program terminated with signal 11, Segmentation fault. +# #0 0x6323c in memcpy () +# (gdb) bt +# #0 0x6323c in memcpy () +# #1 0xf2b0 in fill_section (abfd=0xeaee8, filehdr=0x8a7f4, +# file_cursor=0xf7fff654) at obj-format.c:534 +# #2 0x112a8 in write_object_file () at obj-format.c:1786 +# #3 0x13ef8 in main (argc=5, argv=0xf7fff7bc) at ../../p3/gas/as.c:310 +# (gdb) +# +# gas did manage to create the .o file at this point. + + .bss + +_ASIC_INT_TBL: .space 32,0 | keep interrupt routines here diff --git a/gas/testsuite/gas/m68k-coff/p2389a.s b/gas/testsuite/gas/m68k-coff/p2389a.s new file mode 100644 index 00000000000..76b27657ad0 --- /dev/null +++ b/gas/testsuite/gas/m68k-coff/p2389a.s @@ -0,0 +1,3 @@ + .bss + +_ASIC_INT_TBL: .space 32,1 | keep interrupt routines here diff --git a/gas/testsuite/gas/m68k-coff/p2430.s b/gas/testsuite/gas/m68k-coff/p2430.s new file mode 100644 index 00000000000..49723d9df34 --- /dev/null +++ b/gas/testsuite/gas/m68k-coff/p2430.s @@ -0,0 +1,6 @@ +# This differs from p2430a.s (the customer's actual source file) only +# in whitespace and comments. Strangely, this file gave no problems... + + .sect foo +tag: + bra tag diff --git a/gas/testsuite/gas/m68k-coff/p2430a.s b/gas/testsuite/gas/m68k-coff/p2430a.s new file mode 100644 index 00000000000..601fb117d9e --- /dev/null +++ b/gas/testsuite/gas/m68k-coff/p2430a.s @@ -0,0 +1,4 @@ + .sect foo + +tag: + bra tag diff --git a/gas/testsuite/gas/m68k-coff/t1.s b/gas/testsuite/gas/m68k-coff/t1.s new file mode 100644 index 00000000000..cc015f2a0de --- /dev/null +++ b/gas/testsuite/gas/m68k-coff/t1.s @@ -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 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/m68k/t2.s b/gas/testsuite/gas/m68k/t2.s new file mode 100644 index 00000000000..7b71e86ff97 --- /dev/null +++ b/gas/testsuite/gas/m68k/t2.s @@ -0,0 +1,6 @@ + .text +loop2: + move.l %d1,%a0@+ + dbf %d0,loop1 + .data +loop1: bra loop2 diff --git a/gas/testsuite/gas/p2389.s b/gas/testsuite/gas/p2389.s deleted file mode 100644 index 3fa93e9b478..00000000000 --- a/gas/testsuite/gas/p2389.s +++ /dev/null @@ -1,19 +0,0 @@ -# I reached a point where the file looks -# clean and complies with gas syntax, but it core dumps gas. Here's a -# little gdb info: -# -# Program terminated with signal 11, Segmentation fault. -# #0 0x6323c in memcpy () -# (gdb) bt -# #0 0x6323c in memcpy () -# #1 0xf2b0 in fill_section (abfd=0xeaee8, filehdr=0x8a7f4, -# file_cursor=0xf7fff654) at obj-format.c:534 -# #2 0x112a8 in write_object_file () at obj-format.c:1786 -# #3 0x13ef8 in main (argc=5, argv=0xf7fff7bc) at ../../p3/gas/as.c:310 -# (gdb) -# -# gas did manage to create the .o file at this point. - - .bss - -_ASIC_INT_TBL: .space 32,0 | keep interrupt routines here diff --git a/gas/testsuite/gas/p2389a.s b/gas/testsuite/gas/p2389a.s deleted file mode 100644 index 76b27657ad0..00000000000 --- a/gas/testsuite/gas/p2389a.s +++ /dev/null @@ -1,3 +0,0 @@ - .bss - -_ASIC_INT_TBL: .space 32,1 | keep interrupt routines here diff --git a/gas/testsuite/gas/p2411.s b/gas/testsuite/gas/p2411.s deleted file mode 100644 index 3e4f932de0b..00000000000 --- a/gas/testsuite/gas/p2411.s +++ /dev/null @@ -1,14 +0,0 @@ -# The assembler is failing with error 'FATAL:failed sanity check', giving -# the line of the 'dbf' instruction as the offending line. -# -# This will assemble ok if the section is '.text'. However we must -# be able to use a different section name. -# -# Our only workaround is to recode all of our loops to not use dbf. - - - .sect other - - loop1: - move.l %d1,%a0@+ - dbf %d0,loop1 diff --git a/gas/testsuite/gas/p2425.s b/gas/testsuite/gas/p2425.s deleted file mode 100644 index c3476a46d05..00000000000 --- a/gas/testsuite/gas/p2425.s +++ /dev/null @@ -1,6 +0,0 @@ - .text - .globl _frobnitz -_frobnitz: - .long 1, 2, 3, 4, 5, 6, 7, GRUMP, 42 -GRUMP=.-_frobnitz -HALFGRUMP=GRUMP/2 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/p2430.s b/gas/testsuite/gas/p2430.s deleted file mode 100644 index 49723d9df34..00000000000 --- a/gas/testsuite/gas/p2430.s +++ /dev/null @@ -1,6 +0,0 @@ -# This differs from p2430a.s (the customer's actual source file) only -# in whitespace and comments. Strangely, this file gave no problems... - - .sect foo -tag: - bra tag diff --git a/gas/testsuite/gas/p2430a.s b/gas/testsuite/gas/p2430a.s deleted file mode 100644 index 601fb117d9e..00000000000 --- a/gas/testsuite/gas/p2430a.s +++ /dev/null @@ -1,4 +0,0 @@ - .sect foo - -tag: - bra tag diff --git a/gas/testsuite/gas/sol-cc.s b/gas/testsuite/gas/sol-cc.s deleted file mode 100644 index 8a250dabb93..00000000000 --- a/gas/testsuite/gas/sol-cc.s +++ /dev/null @@ -1,81 +0,0 @@ - .section ".text" ! [internal] - .proc 4 - .global main - .align 4 - .global main -main: -!#PROLOGUE# 0 -!#PROLOGUE# 1 - save %sp,-96,%sp - sethi %hi(.L18),%o0 - sethi %hi(msg),%o1 - or %o1,%lo(msg),%o1 ! [internal] - call printf,2 - or %o0,%lo(.L18),%o0 ! [internal] - ret - restore %g0,0,%o0 - .type main,#function - .size main,(.-main) - .section ".data" ! [internal] - .align 4 -Ddata.data: - .section ".bss" ! [internal] -Bbss.bss: - .section ".rodata" ! [internal] -Drodata.rodata: - .file "hi-sol.c" - .global msg - .global msg -msg: - .ascii "hello, world!\0" - .type msg,#object - .size msg,14 - .section ".data1", #write, #alloc ! [internal] - .align 4 -.L18: - .ascii "%s\n\0" - .ident "acomp: (CDS) SPARCompilers 2.0.1 03 Sep 1992" - .section "text" ! [internal] - .stabs "/cygint/s1/users/raeburn/",100,0,0,0 - .stabs "hi-sol.c",100,0,3,0 - .stabs "",56,0,0,0 - .stabs "",56,0,0,0 - .stabs "Xt ; g ; O ; V=2.0",60,0,0,0x2bb773ba - .stabs "char:t(0,1)=bsc1;0;8;",128,0,0,0 - .stabs "short:t(0,2)=bs2;0;16;",128,0,0,0 - .stabs "int:t(0,3)=bs4;0;32;",128,0,0,0 - .stabs "long:t(0,4)=bs4;0;32;",128,0,0,0 - .stabs "long long:t(0,5)=bs8;0;64;",128,0,0,0 - .stabs "signed char:t(0,6)=bsc1;0;8;",128,0,0,0 - .stabs "signed short:t(0,7)=bs2;0;16;",128,0,0,0 - .stabs "signed int:t(0,8)=bs4;0;32;",128,0,0,0 - .stabs "signed long:t(0,9)=bs4;0;32;",128,0,0,0 - .stabs "signed long long:t(0,10)=bs8;0;64;",128,0,0,0 - .stabs "unsigned char:t(0,11)=buc1;0;8;",128,0,0,0 - .stabs "unsigned short:t(0,12)=bu2;0;16;",128,0,0,0 - .stabs "unsigned int:t(0,13)=bu4;0;32;",128,0,0,0 - .stabs "unsigned long:t(0,14)=bu4;0;32;",128,0,0,0 - .stabs "unsigned long long:t(0,15)=bu8;0;64;",128,0,0,0 - .stabs "float:t(0,16)=R1;4;",128,0,0,0 - .stabs "double:t(0,17)=R2;8;",128,0,0,0 - .stabs "long double:t(0,18)=R6;16;",128,0,0,0 - .stabs "void:t(0,19)=bs0;0;0",128,0,0,0 - .stabs "msg:G(0,20)=ar(0,3);0;13;(0,1)",32,0,14,0 - .stabs "main:F(0,3);(0,3);(0,21)=*(0,22)=*(0,1)",36,0,0,main - .stabs "main",42,0,0,0 - .stabn 192,0,1,0 - .stabn 68,0,4,0 - .stabs "argc:p(0,3)",160,0,4,68 - .stabs "argv:p(0,21)",160,0,4,72 - .stabs "printf:P(0,3)",36,0,0,0 - .stabn 224,0,1,0 - .stabs "",98,0,0,0 - .section "text" ! [internal] - .xstabs ".stab.index","/cygint/s1/users/raeburn/",100,0,0,0 - .xstabs ".stab.index","hi-sol.c",100,0,3,0 - .xstabs ".stab.index","",56,0,0,0 - .xstabs ".stab.index","",56,0,0,0 - .xstabs ".stab.index","Xt ; g ; O ; V=2.0",60,0,0,0x2bb773ba - .xstabs ".stab.index","msg",32,0,0,0 - .xstabs ".stab.index","main",42,0,0,0 - .xstabs ".stab.index","main",36,0,0,0 diff --git a/gas/testsuite/gas/sol-gcc.s b/gas/testsuite/gas/sol-gcc.s deleted file mode 100644 index 295fdcdd889..00000000000 --- a/gas/testsuite/gas/sol-gcc.s +++ /dev/null @@ -1,66 +0,0 @@ - .file "hi-sol.c" -.stabs "/1h/devo/src/gas/testsuite/gas/",100,0,0,.LLtext0 -.stabs "hi-sol.c",100,0,0,.LLtext0 -.section ".text" -.LLtext0: - .stabs "gcc2_compiled.", 0x3c, 0, 0, 0 -.stabs "int:t1=r1;-2147483648;2147483647;",128,0,0,0 -.stabs "char:t2=r2;0;127;",128,0,0,0 -.stabs "long int:t3=r1;-2147483648;2147483647;",128,0,0,0 -.stabs "unsigned int:t4=r1;0;-1;",128,0,0,0 -.stabs "long unsigned int:t5=r1;0;-1;",128,0,0,0 -.stabs "short int:t6=r1;-32768;32767;",128,0,0,0 -.stabs "long long int:t7=r1;0;-1;",128,0,0,0 -.stabs "short unsigned int:t8=r1;0;65535;",128,0,0,0 -.stabs "long long unsigned int:t9=r1;0;-1;",128,0,0,0 -.stabs "signed char:t10=r1;-128;127;",128,0,0,0 -.stabs "unsigned char:t11=r1;0;255;",128,0,0,0 -.stabs "float:t12=r1;4;0;",128,0,0,0 -.stabs "double:t13=r1;8;0;",128,0,0,0 -.stabs "long double:t14=r1;8;0;",128,0,0,0 -.stabs "void:t15=15",128,0,0,0 -.stabs "msg:G16=ar1;0;13;2",32,0,0,0 - .global msg -.section ".rodata" - .align 8 - .type msg,#object - .size msg,14 -msg: - .asciz "hello, world!" - .align 8 -.LLC0: - .asciz "%s\n" -.section ".text" - .align 4 -.stabs "main:F1",36,0,0,main -.stabs "argc:P1",64,0,0,24 -.stabs "argv:P17=*18=*2",64,0,0,25 - .global main - .type main,#function - .proc 04 -main: -.stabn 68,0,4,.LM1-main -.LM1: - !#PROLOGUE# 0 - save %sp,-112,%sp - !#PROLOGUE# 1 -.stabn 68,0,5,.LM2-main -.LM2: -.LLBB2: - sethi %hi(.LLC0),%o0 - or %o0,%lo(.LLC0),%o0 - sethi %hi(msg),%o1 - call printf,0 - or %o1,%lo(msg),%o1 -.stabn 68,0,6,.LM3-main -.LM3: -.stabn 68,0,7,.LM4-main -.LM4: -.LLBE2: - ret - restore %g0,0,%o0 -.LLfe1: - .size main,.LLfe1-main -.stabn 192,0,0,.LLBB2-main -.stabn 224,0,0,.LLBE2-main - .ident "GCC: (GNU) cygnus-2.3.3" 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/sparc-solaris/sol-cc.s b/gas/testsuite/gas/sparc-solaris/sol-cc.s new file mode 100644 index 00000000000..8a250dabb93 --- /dev/null +++ b/gas/testsuite/gas/sparc-solaris/sol-cc.s @@ -0,0 +1,81 @@ + .section ".text" ! [internal] + .proc 4 + .global main + .align 4 + .global main +main: +!#PROLOGUE# 0 +!#PROLOGUE# 1 + save %sp,-96,%sp + sethi %hi(.L18),%o0 + sethi %hi(msg),%o1 + or %o1,%lo(msg),%o1 ! [internal] + call printf,2 + or %o0,%lo(.L18),%o0 ! [internal] + ret + restore %g0,0,%o0 + .type main,#function + .size main,(.-main) + .section ".data" ! [internal] + .align 4 +Ddata.data: + .section ".bss" ! [internal] +Bbss.bss: + .section ".rodata" ! [internal] +Drodata.rodata: + .file "hi-sol.c" + .global msg + .global msg +msg: + .ascii "hello, world!\0" + .type msg,#object + .size msg,14 + .section ".data1", #write, #alloc ! [internal] + .align 4 +.L18: + .ascii "%s\n\0" + .ident "acomp: (CDS) SPARCompilers 2.0.1 03 Sep 1992" + .section "text" ! [internal] + .stabs "/cygint/s1/users/raeburn/",100,0,0,0 + .stabs "hi-sol.c",100,0,3,0 + .stabs "",56,0,0,0 + .stabs "",56,0,0,0 + .stabs "Xt ; g ; O ; V=2.0",60,0,0,0x2bb773ba + .stabs "char:t(0,1)=bsc1;0;8;",128,0,0,0 + .stabs "short:t(0,2)=bs2;0;16;",128,0,0,0 + .stabs "int:t(0,3)=bs4;0;32;",128,0,0,0 + .stabs "long:t(0,4)=bs4;0;32;",128,0,0,0 + .stabs "long long:t(0,5)=bs8;0;64;",128,0,0,0 + .stabs "signed char:t(0,6)=bsc1;0;8;",128,0,0,0 + .stabs "signed short:t(0,7)=bs2;0;16;",128,0,0,0 + .stabs "signed int:t(0,8)=bs4;0;32;",128,0,0,0 + .stabs "signed long:t(0,9)=bs4;0;32;",128,0,0,0 + .stabs "signed long long:t(0,10)=bs8;0;64;",128,0,0,0 + .stabs "unsigned char:t(0,11)=buc1;0;8;",128,0,0,0 + .stabs "unsigned short:t(0,12)=bu2;0;16;",128,0,0,0 + .stabs "unsigned int:t(0,13)=bu4;0;32;",128,0,0,0 + .stabs "unsigned long:t(0,14)=bu4;0;32;",128,0,0,0 + .stabs "unsigned long long:t(0,15)=bu8;0;64;",128,0,0,0 + .stabs "float:t(0,16)=R1;4;",128,0,0,0 + .stabs "double:t(0,17)=R2;8;",128,0,0,0 + .stabs "long double:t(0,18)=R6;16;",128,0,0,0 + .stabs "void:t(0,19)=bs0;0;0",128,0,0,0 + .stabs "msg:G(0,20)=ar(0,3);0;13;(0,1)",32,0,14,0 + .stabs "main:F(0,3);(0,3);(0,21)=*(0,22)=*(0,1)",36,0,0,main + .stabs "main",42,0,0,0 + .stabn 192,0,1,0 + .stabn 68,0,4,0 + .stabs "argc:p(0,3)",160,0,4,68 + .stabs "argv:p(0,21)",160,0,4,72 + .stabs "printf:P(0,3)",36,0,0,0 + .stabn 224,0,1,0 + .stabs "",98,0,0,0 + .section "text" ! [internal] + .xstabs ".stab.index","/cygint/s1/users/raeburn/",100,0,0,0 + .xstabs ".stab.index","hi-sol.c",100,0,3,0 + .xstabs ".stab.index","",56,0,0,0 + .xstabs ".stab.index","",56,0,0,0 + .xstabs ".stab.index","Xt ; g ; O ; V=2.0",60,0,0,0x2bb773ba + .xstabs ".stab.index","msg",32,0,0,0 + .xstabs ".stab.index","main",42,0,0,0 + .xstabs ".stab.index","main",36,0,0,0 diff --git a/gas/testsuite/gas/sparc-solaris/sol-gcc.s b/gas/testsuite/gas/sparc-solaris/sol-gcc.s new file mode 100644 index 00000000000..295fdcdd889 --- /dev/null +++ b/gas/testsuite/gas/sparc-solaris/sol-gcc.s @@ -0,0 +1,66 @@ + .file "hi-sol.c" +.stabs "/1h/devo/src/gas/testsuite/gas/",100,0,0,.LLtext0 +.stabs "hi-sol.c",100,0,0,.LLtext0 +.section ".text" +.LLtext0: + .stabs "gcc2_compiled.", 0x3c, 0, 0, 0 +.stabs "int:t1=r1;-2147483648;2147483647;",128,0,0,0 +.stabs "char:t2=r2;0;127;",128,0,0,0 +.stabs "long int:t3=r1;-2147483648;2147483647;",128,0,0,0 +.stabs "unsigned int:t4=r1;0;-1;",128,0,0,0 +.stabs "long unsigned int:t5=r1;0;-1;",128,0,0,0 +.stabs "short int:t6=r1;-32768;32767;",128,0,0,0 +.stabs "long long int:t7=r1;0;-1;",128,0,0,0 +.stabs "short unsigned int:t8=r1;0;65535;",128,0,0,0 +.stabs "long long unsigned int:t9=r1;0;-1;",128,0,0,0 +.stabs "signed char:t10=r1;-128;127;",128,0,0,0 +.stabs "unsigned char:t11=r1;0;255;",128,0,0,0 +.stabs "float:t12=r1;4;0;",128,0,0,0 +.stabs "double:t13=r1;8;0;",128,0,0,0 +.stabs "long double:t14=r1;8;0;",128,0,0,0 +.stabs "void:t15=15",128,0,0,0 +.stabs "msg:G16=ar1;0;13;2",32,0,0,0 + .global msg +.section ".rodata" + .align 8 + .type msg,#object + .size msg,14 +msg: + .asciz "hello, world!" + .align 8 +.LLC0: + .asciz "%s\n" +.section ".text" + .align 4 +.stabs "main:F1",36,0,0,main +.stabs "argc:P1",64,0,0,24 +.stabs "argv:P17=*18=*2",64,0,0,25 + .global main + .type main,#function + .proc 04 +main: +.stabn 68,0,4,.LM1-main +.LM1: + !#PROLOGUE# 0 + save %sp,-112,%sp + !#PROLOGUE# 1 +.stabn 68,0,5,.LM2-main +.LM2: +.LLBB2: + sethi %hi(.LLC0),%o0 + or %o0,%lo(.LLC0),%o0 + sethi %hi(msg),%o1 + call printf,0 + or %o1,%lo(msg),%o1 +.stabn 68,0,6,.LM3-main +.LM3: +.stabn 68,0,7,.LM4-main +.LM4: +.LLBE2: + ret + restore %g0,0,%o0 +.LLfe1: + .size main,.LLfe1-main +.stabn 192,0,0,.LLBB2-main +.stabn 224,0,0,.LLBE2-main + .ident "GCC: (GNU) cygnus-2.3.3" diff --git a/gas/testsuite/gas/t1.s b/gas/testsuite/gas/t1.s deleted file mode 100644 index cc015f2a0de..00000000000 --- a/gas/testsuite/gas/t1.s +++ /dev/null @@ -1,36 +0,0 @@ -# 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 diff --git a/gas/testsuite/gas/t2.s b/gas/testsuite/gas/t2.s deleted file mode 100644 index 7b71e86ff97..00000000000 --- a/gas/testsuite/gas/t2.s +++ /dev/null @@ -1,6 +0,0 @@ - .text -loop2: - move.l %d1,%a0@+ - dbf %d0,loop1 - .data -loop1: bra loop2 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"