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