Updated copyright notices for most files.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.disasm / sh3.exp
CommitLineData
9b254dd1 1# Copyright (C) 1992, 1997, 2007, 2008 Free Software Foundation, Inc.
c906108c
SS
2
3# This program is free software; you can redistribute it and/or modify
4# it under the terms of the GNU General Public License as published by
e22f8b7c 5# the Free Software Foundation; either version 3 of the License, or
c906108c 6# (at your option) any later version.
e22f8b7c 7#
c906108c
SS
8# This program is distributed in the hope that it will be useful,
9# but WITHOUT ANY WARRANTY; without even the implied warranty of
10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11# GNU General Public License for more details.
e22f8b7c 12#
c906108c 13# You should have received a copy of the GNU General Public License
e22f8b7c 14# along with this program. If not, see <http://www.gnu.org/licenses/>.
c906108c
SS
15
16# Please email any bugs, comments, and/or additions to this file to:
17# bug-gdb@prep.ai.mit.edu
18
19# This file was written by Jeff Law. (law@cs.utah.edu)
20
21if $tracelevel then {
22 strace $tracelevel
23}
24
25if ![istarget "sh3*-*-*"] {
26 verbose "Tests ignored for all but sh3 based targets."
27 return
28}
29
30set prms_id 0
31set bug_id 0
32
33set testfile "sh3"
34set srcfile ${srcdir}/${subdir}/${testfile}.s
35set binfile ${objdir}/${subdir}/${testfile}
36if { [gdb_compile "${srcfile}" "${binfile}" executable ""] != "" } {
b60f0898
JB
37 untested sh3.exp
38 return -1
c906108c
SS
39}
40
41proc all_fp_move_and_load_tests { } {
42 global gdb_prompt
43 global hex
44 global decimal
45
46 send_gdb "x/9i fp_move_and_load_tests\n"
47 gdb_expect {
48 -re "
49.*fmov.s\t@r0,fr0.*
50.*fmov.s\tfr0,@r0.*
51.*fmov.s\t@r0\\+,fr0.*
52.*fmov.s\tfr0,@-r0.*
53.*fmov.s\t@\\(r0,r0\\),fr0.*
54.*fmov.s\tfr0,@\\(r0,r0\\).*
55.*fmov\tfr0,fr1.*
56.*fldi0\tfr0.*
57.*fldi1\tfr0.*
58.*$gdb_prompt $" { pass "fp_move_and_load_tests" }
59 -re "$gdb_prompt $" { fail "fp_move_and_load_tests" }
60 timeout { fail "(timeout) fp_move_and_load_tests" }
61 }
62}
63
64proc all_fp_arithmetic_tests { } {
65 global gdb_prompt
66 global hex
67 global decimal
68
69 send_gdb "x/13i fp_arithmetic_tests\n"
70 gdb_expect {
71 -re "
72.*fadd\tfr0,fr1.*
73.*fsub\tfr0,fr1.*
74.*fmul\tfr0,fr1.*
75.*fdiv\tfr0,fr1.*
76.*fmac\tfr0,fr0,fr1.*
77.*fcmp/eq\tfr0,fr1.*
78.*fcmp/gt\tfr0,fr1.*
79.*ftst/nan\tfr0.*
80.*fneg\tfr0.*
81.*fabs\tfr0.*
82.*fsqrt\tfr0.*
83.*float\tfpul,fr0.*
84.*ftrc\tfr0,fpul.*
85.*$gdb_prompt $" { pass "fp_arithmetic_tests" }
86 -re "$gdb_prompt $" { fail "fp_arithmetic_tests" }
87 timeout { fail "(timeout) fp_arithmetic_tests" }
88 }
89}
90
91proc all_fp_misc_tests { } {
92 global gdb_prompt
93 global hex
94 global decimal
95
96 send_gdb "x/10i fp_misc_tests\n"
97 gdb_expect {
98 -re "
99.*fsts\tfpul,fr0.*
100.*flds\tfr0,fpul.*
101.*lds\tr3,fpul.*
102.*lds\\.l\t@r3\\+,fpul.*
103.*lds\tr3,fpscr.*
104.*lds\\.l\t@r3\\+,fpscr.*
105.*sts\tfpul,r3.*
106.*sts\\.l\tfpul,@-r3.*
107.*sts\tfpscr,r3.*
108.*sts\\.l\tfpscr,@-r3.*
109.*$gdb_prompt $" { pass "fp_misc_tests" }
110 -re "$gdb_prompt $" { fail "fp_misc_tests" }
111 timeout { fail "(timeout) fp_misc_tests" }
112 }
113}
114
115gdb_exit
116gdb_start
117gdb_reinitialize_dir $srcdir/$subdir
118gdb_load $binfile
119
120all_fp_move_and_load_tests
121all_fp_arithmetic_tests
122all_fp_misc_tests
123
This page took 0.736953 seconds and 4 git commands to generate.