summaryrefslogtreecommitdiff
path: root/gas/testsuite/gas/sh/basic.exp
blob: 30dbb0b2d06753843c18a05cdf17951879134b40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# Copyright (C) 1995, 1996, 1997 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_fp {} {
    set testname "fp.s: floating point tests (sh3e)"
    set x 0

    gas_start "fp.s" "-al"

    # Check the assembled instruction against a table built by the HP assembler
    # Any differences should be checked by hand -- with the number of problems
    # I've seen in the HP assembler I don't completely trust it.
    #
    # 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 F008\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0002 F00A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0004 F009\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0006 F00B\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0008 F006\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 000a F007\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 000c F10C\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 000e F08D\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0010 F09D\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0012 F100\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0014 F101\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0016 F102\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0018 F103\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 001a F10E\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 001c F104\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 001e F105\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0020 F04D\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0022 F05D\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0024 F06D\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0026 F02D\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0028 F03D\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 002a F00D\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 002c F01D\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 002e 435A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0030 4356\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0032 436A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0034 4366\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0036 035A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 0038 4352\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 003a 036A\[^\n\]*\n"	{ set x [expr $x+1] }
	    -re "^ +\[0-9\]+ 003c 4362\[^\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==31] then { pass $testname } else { fail $testname }
}


if [istarget sh*-*-*] then {
    # Test the basic instruction parser.
    do_fp
}