From c3fa8cd69c1868a8c7a7ab4f57d62edbfe9238cf Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Wed, 9 Oct 1996 20:19:00 +0000 Subject: [PATCH] * gas/mn10300/{add.s, bcc.s, bit.s, cmp.s, ext.s}: New tests. * gas/mn10300/{extend.s logical.s, loop.s, mov1.s}: Likewise. * gas/mn10300/{mov2.s, mov3.s, mov4.s, movbu.s}: Likewise. * gas/mn10300/{movhu.s, movm.s, muldiv.s, other.s}: Likewise. * gas/mn10300/{shift.s, sub.s}: Likewise. * gas/mn10300/basic.exp: Run them. Beginnings of gas testsuite for mn10300. Matsushita. --- gas/testsuite/ChangeLog | 9 + gas/testsuite/gas/mn10300/.Sanitize | 20 + gas/testsuite/gas/mn10300/basic.exp | 797 ++++++++++++++++++++++++++++ gas/testsuite/gas/mn10300/bcc.s | 17 + gas/testsuite/gas/mn10300/loop.s | 15 + gas/testsuite/gas/mn10300/mov1.s | 16 + 6 files changed, 874 insertions(+) create mode 100755 gas/testsuite/gas/mn10300/basic.exp create mode 100755 gas/testsuite/gas/mn10300/bcc.s create mode 100755 gas/testsuite/gas/mn10300/loop.s create mode 100755 gas/testsuite/gas/mn10300/mov1.s diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 02d0a5ce8e2..52f1c91e24e 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,12 @@ +Wed Oct 9 14:15:18 1996 Jeffrey A Law (law@cygnus.com) + + * gas/mn10300/{add.s, bcc.s, bit.s, cmp.s, ext.s}: New tests. + * gas/mn10300/{extend.s logical.s, loop.s, mov1.s}: Likewise. + * gas/mn10300/{mov2.s, mov3.s, mov4.s, movbu.s}: Likewise. + * gas/mn10300/{movhu.s, movm.s, muldiv.s, other.s}: Likewise. + * gas/mn10300/{shift.s, sub.s}: Likewise. + * gas/mn10300/basic.exp: Run them. + Thu Oct 3 09:57:03 1996 Jeffrey A Law (law@cygnus.com) * gas/mn10200, gas/mn10300: New directorys for Matsushita diff --git a/gas/testsuite/gas/mn10300/.Sanitize b/gas/testsuite/gas/mn10300/.Sanitize index b34d4981a23..a421ee29209 100644 --- a/gas/testsuite/gas/mn10300/.Sanitize +++ b/gas/testsuite/gas/mn10300/.Sanitize @@ -24,6 +24,26 @@ Do-first: # with rm -rf. Things-to-keep: +add.s +basic.exp +bcc.s +bit.s +cmp.s +ext.s +extend.s +logical.s +loop.s +mov1.s +mov2.s +mov3.s +mov4.s +movbu.s +movhu.s +movm.s +muldiv.s +other.s +shift.s +sub.s Things-to-lose: diff --git a/gas/testsuite/gas/mn10300/basic.exp b/gas/testsuite/gas/mn10300/basic.exp new file mode 100755 index 00000000000..02655783b42 --- /dev/null +++ b/gas/testsuite/gas/mn10300/basic.exp @@ -0,0 +1,797 @@ +# Copyright (C) 1996 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +# Please email any bugs, comments, and/or additions to this file to: +# DejaGnu@cygnus.com + +# Written by Cygnus Support. + +proc do_add {} { + set testname "add.s: Add operations" + set x 0 + + gas_start "add.s" "-al" + + # Instead of having a variable for each match string just increment the + # total number of matches seen. That's simpler when testing large numbers + # of instructions (as these tests to). + while 1 { + expect { + -re "^ +\[0-9\]+ 0000\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0001\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0003\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0005\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0007\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0009\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 000d\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0013\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0015\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0019\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 001f\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0022\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0026\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 002c\[^\n\]*\n" { set x [expr $x+1] } + -re "\[^\n\]*\n" { } + timeout { perror "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 [expr $x==14] then { pass $testname } else { fail $testname } +} + +proc do_bcc {} { + set testname "bcc.s: Bcc tests" + set x 0 + + gas_start "bcc.s" "-al" + + # Instead of having a variable for each match string just increment the + # total number of matches seen. That's simpler when testing large numbers + # of instructions (as these tests to). + while 1 { + expect { + -re "^ +\[0-9\]+ 0000\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0002\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0004\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0006\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0008\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 000a\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 000c\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 000e\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0010\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0012\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0014\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0017\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 001a\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 001d\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0020\[^\n\]*\n" { set x [expr $x+1] } + -re "\[^\n\]*\n" { } + timeout { perror "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 [expr $x==15] then { pass $testname } else { fail $testname } +} + +proc do_bit {} { + set testname "bit.s: bit tests" + set x 0 + + gas_start "bit.s" "-al" + + # Instead of having a variable for each match string just increment the + # total number of matches seen. That's simpler when testing large numbers + # of instructions (as these tests to). + while 1 { + expect { + -re "^ +\[0-9\]+ 0000\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0003\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0007\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 000d\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0011\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0018\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 001a\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 001e\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0025\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0027\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 002b\[^\n\]*\n" { set x [expr $x+1] } + -re "\[^\n\]*\n" { } + timeout { perror "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 [expr $x==11] then { pass $testname } else { fail $testname } +} + +proc do_cmp {} { + set testname "cmp.s: cmp tests" + set x 0 + + gas_start "cmp.s" "-al" + + # Instead of having a variable for each match string just increment the + # total number of matches seen. That's simpler when testing large numbers + # of instructions (as these tests to). + while 1 { + expect { + -re "^ +\[0-9\]+ 0000\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0001\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0003\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0005\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0006\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0008\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 000c\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0012\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0014\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0018\[^\n\]*\n" { set x [expr $x+1] } + -re "\[^\n\]*\n" { } + timeout { perror "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 [expr $x==10] then { pass $testname } else { fail $testname } +} + +proc do_ext {} { + set testname "ext.s: ext tests" + set x 0 + + gas_start "ext.s" "-al" + + # Instead of having a variable for each match string just increment the + # total number of matches seen. That's simpler when testing large numbers + # of instructions (as these tests to). + while 1 { + expect { + -re "^ +\[0-9\]+ 0000\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0002\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0003\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0004\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0005\[^\n\]*\n" { set x [expr $x+1] } + -re "\[^\n\]*\n" { } + timeout { perror "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 [expr $x==5] then { pass $testname } else { fail $testname } +} + +proc do_extend {} { + set testname "extend.s: extended instruction tests" + set x 0 + + gas_start "extend.s" "-al" + + # Instead of having a variable for each match string just increment the + # total number of matches seen. That's simpler when testing large numbers + # of instructions (as these tests to). + while 1 { + expect { + -re "^ +\[0-9\]+ 0000\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0002\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0004\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0006\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0009\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 000d\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0013\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0015\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0018\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 001c\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0022\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0024\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0026\[^\n\]*\n" { set x [expr $x+1] } + -re "\[^\n\]*\n" { } + timeout { perror "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 [expr $x==13] then { pass $testname } else { fail $testname } +} + +proc do_logical {} { + set testname "logical.s: logical tests" + set x 0 + + gas_start "logical.s" "-al" + + # Instead of having a variable for each match string just increment the + # total number of matches seen. That's simpler when testing large numbers + # of instructions (as these tests to). + while 1 { + expect { + -re "^ +\[0-9\]+ 0000\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0002\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0005\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0009\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 000f\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0013\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0015\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0018\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 001c\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0022\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0026\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0028\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 002c\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0032\[^\n\]*\n" { set x [expr $x+1] } + -re "\[^\n\]*\n" { } + timeout { perror "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 [expr $x==14] then { pass $testname } else { fail $testname } +} + +proc do_loop {} { + set testname "loop.s: loop tests" + set x 0 + + gas_start "loop.s" "-al" + + # Instead of having a variable for each match string just increment the + # total number of matches seen. That's simpler when testing large numbers + # of instructions (as these tests to). + while 1 { + expect { + -re "^ +\[0-9\]+ 0000\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0001\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0002\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0003\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0004\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0005\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0006\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0007\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0008\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0009\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 000a\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 000b\[^\n\]*\n" { set x [expr $x+1] } + -re "\[^\n\]*\n" { } + timeout { perror "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 [expr $x==12] then { pass $testname } else { fail $testname } +} + +proc do_mov1 {} { + set testname "mov1.s: mov1 tests" + set x 0 + + gas_start "mov1.s" "-al" + + # Instead of having a variable for each match string just increment the + # total number of matches seen. That's simpler when testing large numbers + # of instructions (as these tests to). + while 1 { + expect { + -re "^ +\[0-9\]+ 0000\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0001\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0003\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0005\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0006\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0007\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0009\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 000b\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 000d\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 000f\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0010\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0013\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0017\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 001d\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 001f\[^\n\]*\n" { set x [expr $x+1] } + -re "\[^\n\]*\n" { } + timeout { perror "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 [expr $x==15] then { pass $testname } else { fail $testname } +} + +proc do_mov2 {} { + set testname "mov2.s: mov2 tests" + set x 0 + + gas_start "mov2.s" "-al" + + # Instead of having a variable for each match string just increment the + # total number of matches seen. That's simpler when testing large numbers + # of instructions (as these tests to). + while 1 { + expect { + -re "^ +\[0-9\]+ 0000\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0006\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0008\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 000b\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0011\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0013\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0016\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 001a\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0020\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0022\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0026\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 002c\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 002e\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0032\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0038\[^\n\]*\n" { set x [expr $x+1] } + -re "\[^\n\]*\n" { } + timeout { perror "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 [expr $x==15] then { pass $testname } else { fail $testname } +} + +proc do_mov3 {} { + set testname "mov3.s: mov3 tests" + set x 0 + + gas_start "mov3.s" "-al" + + # Instead of having a variable for each match string just increment the + # total number of matches seen. That's simpler when testing large numbers + # of instructions (as these tests to). + while 1 { + expect { + -re "^ +\[0-9\]+ 0000\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0001\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0004\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0008\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 000e\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0010\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0014\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 001a\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 001c\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 001f\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0025\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0027\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 002a\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 002e\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0034\[^\n\]*\n" { set x [expr $x+1] } + -re "\[^\n\]*\n" { } + timeout { perror "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 [expr $x==15] then { pass $testname } else { fail $testname } +} + +proc do_mov4 {} { + set testname "mov4.s: mov4 tests" + set x 0 + + gas_start "mov4.s" "-al" + + # Instead of having a variable for each match string just increment the + # total number of matches seen. That's simpler when testing large numbers + # of instructions (as these tests to). + while 1 { + expect { + -re "^ +\[0-9\]+ 0000\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0004\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 000a\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 000c\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0010\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0016\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0019\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 001b\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 001e\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0024\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0026\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0029\[^\n\]*\n" { set x [expr $x+1] } + -re "\[^\n\]*\n" { } + timeout { perror "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 [expr $x==12] then { pass $testname } else { fail $testname } +} + +proc do_movbu {} { + set testname "movbu.s: movbu tests" + set x 0 + + gas_start "movbu.s" "-al" + + # Instead of having a variable for each match string just increment the + # total number of matches seen. That's simpler when testing large numbers + # of instructions (as these tests to). + while 1 { + expect { + -re "^ +\[0-9\]+ 0000\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0002\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0005\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0009\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 000f\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0012\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0016\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 001c\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 001e\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0021\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0027\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0029\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 002c\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0030\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0036\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0039\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 003d\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0043\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0045\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0048\[^\n\]*\n" { set x [expr $x+1] } + -re "\[^\n\]*\n" { } + timeout { perror "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 [expr $x==20] then { pass $testname } else { fail $testname } +} + +proc do_movbu {} { + set testname "movbu.s: movbu tests" + set x 0 + + gas_start "movbu.s" "-al" + + # Instead of having a variable for each match string just increment the + # total number of matches seen. That's simpler when testing large numbers + # of instructions (as these tests to). + while 1 { + expect { + -re "^ +\[0-9\]+ 0000\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0002\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0005\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0009\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 000f\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0012\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0016\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 001c\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 001e\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0021\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0027\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0029\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 002c\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0030\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0036\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0039\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 003d\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0043\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0045\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0048\[^\n\]*\n" { set x [expr $x+1] } + -re "\[^\n\]*\n" { } + timeout { perror "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 [expr $x==20] then { pass $testname } else { fail $testname } +} + +proc do_movhu {} { + set testname "movhu.s: movhu tests" + set x 0 + + gas_start "movhu.s" "-al" + + # Instead of having a variable for each match string just increment the + # total number of matches seen. That's simpler when testing large numbers + # of instructions (as these tests to). + while 1 { + expect { + -re "^ +\[0-9\]+ 0000\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0002\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0005\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0009\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 000f\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0012\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0016\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 001c\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 001e\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0021\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0027\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0029\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 002c\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0030\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0036\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0039\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 003d\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0043\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0045\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0048\[^\n\]*\n" { set x [expr $x+1] } + -re "\[^\n\]*\n" { } + timeout { perror "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 [expr $x==20] then { pass $testname } else { fail $testname } +} + +proc do_movm {} { + set testname "movm.s: movm tests" + set x 0 + + gas_start "movm.s" "-al" + + # Instead of having a variable for each match string just increment the + # total number of matches seen. That's simpler when testing large numbers + # of instructions (as these tests to). + while 1 { + expect { + -re "^ +\[0-9\]+ 0000\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0002\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0004\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0006\[^\n\]*\n" { set x [expr $x+1] } + -re "\[^\n\]*\n" { } + timeout { perror "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 [expr $x==4] then { pass $testname } else { fail $testname } +} + +proc do_muldiv {} { + set testname "muldiv.s: muldiv tests" + set x 0 + + gas_start "muldiv.s" "-al" + + # Instead of having a variable for each match string just increment the + # total number of matches seen. That's simpler when testing large numbers + # of instructions (as these tests to). + while 1 { + expect { + -re "^ +\[0-9\]+ 0000\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0002\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0004\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0006\[^\n\]*\n" { set x [expr $x+1] } + -re "\[^\n\]*\n" { } + timeout { perror "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 [expr $x==4] then { pass $testname } else { fail $testname } +} + +proc do_other {} { + set testname "other.s: other tests" + set x 0 + + gas_start "other.s" "-al" + + # Instead of having a variable for each match string just increment the + # total number of matches seen. That's simpler when testing large numbers + # of instructions (as these tests to). + while 1 { + expect { + -re "^ +\[0-9\]+ 0000\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0001\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0002\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0003\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0004\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0006\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0009\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 000e\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0013\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 001a\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 001c\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0020\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0026\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0029\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 002c\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 002e\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0030\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0032\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0033\[^\n\]*\n" { set x [expr $x+1] } + -re "\[^\n\]*\n" { } + timeout { perror "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 [expr $x==19] then { pass $testname } else { fail $testname } +} + +proc do_shift {} { + set testname "shift.s: shift tests" + set x 0 + + gas_start "shift.s" "-al" + + # Instead of having a variable for each match string just increment the + # total number of matches seen. That's simpler when testing large numbers + # of instructions (as these tests to). + while 1 { + expect { + -re "^ +\[0-9\]+ 0000\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0002\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0005\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0007\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 000a\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 000c\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 000f\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0010\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0012\[^\n\]*\n" { set x [expr $x+1] } + -re "\[^\n\]*\n" { } + timeout { perror "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 [expr $x==9] then { pass $testname } else { fail $testname } +} + +proc do_sub {} { + set testname "sub.s: sub tests" + set x 0 + + gas_start "sub.s" "-al" + + # Instead of having a variable for each match string just increment the + # total number of matches seen. That's simpler when testing large numbers + # of instructions (as these tests to). + while 1 { + expect { + -re "^ +\[0-9\]+ 0000\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0002\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0004\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0006\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0008\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 000e\[^\n\]*\n" { set x [expr $x+1] } + -re "^ +\[0-9\]+ 0014\[^\n\]*\n" { set x [expr $x+1] } + -re "\[^\n\]*\n" { } + timeout { perror "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 [expr $x==7] then { pass $testname } else { fail $testname } +} + +if [istarget mn10300*-*-*] then { + # Test the basic instruction parser. + do_add + do_bcc + do_bit + do_cmp + do_ext + do_extend + do_logical + do_loop + do_mov1 + do_mov2 + do_mov3 + do_mov4 + do_movbu + do_movhu + do_movm + do_muldiv + do_other + do_shift + do_sub +} diff --git a/gas/testsuite/gas/mn10300/bcc.s b/gas/testsuite/gas/mn10300/bcc.s new file mode 100755 index 00000000000..8292dce04fd --- /dev/null +++ b/gas/testsuite/gas/mn10300/bcc.s @@ -0,0 +1,17 @@ + .text +foo: + beq foo + bne foo + bgt foo + bge foo + ble foo + blt foo + bhi foo + bcc foo + bls foo + bcs foo + bvc foo + bvs foo + bnc foo + bns foo + bra foo diff --git a/gas/testsuite/gas/mn10300/loop.s b/gas/testsuite/gas/mn10300/loop.s new file mode 100755 index 00000000000..d9182070e43 --- /dev/null +++ b/gas/testsuite/gas/mn10300/loop.s @@ -0,0 +1,15 @@ + .text +foo: + leq + lne + lgt + lge + lle + llt + lhi + lcc + lls + lcs + lra + setlb + diff --git a/gas/testsuite/gas/mn10300/mov1.s b/gas/testsuite/gas/mn10300/mov1.s new file mode 100755 index 00000000000..aac5622602a --- /dev/null +++ b/gas/testsuite/gas/mn10300/mov1.s @@ -0,0 +1,16 @@ + .text + mov d1,d2 + mov d1,a2 + mov a2,d1 + mov a2,a1 + mov sp,a2 + mov a1,sp + mov d2,psw + mov mdr,d1 + mov d2,mdr + mov (a2),d1 + mov (8,a2),d1 + mov (256,a2),d1 + mov (65536,a2),d1 + mov (8,sp),d1 + mov (256,sp),d1 -- 2.30.2