]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/testsuite/gdb.disasm/sh3.exp
* config/sh/tm-sh.h (BELIEVE_PCC_PROMOTION): Define, so that
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.disasm / sh3.exp
1 # Copyright (C) 1992 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 2 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, write to the Free Software
15 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
16
17 # Please email any bugs, comments, and/or additions to this file to:
18 # bug-gdb@prep.ai.mit.edu
19
20 # This file was written by Jeff Law. (law@cs.utah.edu)
21
22 if $tracelevel then {
23 strace $tracelevel
24 }
25
26 if ![istarget "sh3*-*-*"] {
27 verbose "Tests ignored for all but sh3 based targets."
28 return
29 }
30
31 set prms_id 0
32 set bug_id 0
33
34 set testfile "sh3"
35 set srcfile ${srcdir}/${subdir}/${testfile}.s
36 set binfile ${objdir}/${subdir}/${testfile}
37 if { [gdb_compile "${srcfile}" "${binfile}" executable ""] != "" } {
38 perror "Couldn't link ${binfile}"
39 return -1
40 }
41
42 proc all_fp_move_and_load_tests { } {
43 global prompt
44 global hex
45 global decimal
46
47 send_gdb "x/9i fp_move_and_load_tests\n"
48 expect {
49 -re "
50 .*fmov.s\t@r0,fr0.*
51 .*fmov.s\tfr0,@r0.*
52 .*fmov.s\t@r0\\+,fr0.*
53 .*fmov.s\tfr0,@-r0.*
54 .*fmov.s\t@\\(r0,r0\\),fr0.*
55 .*fmov.s\tfr0,@\\(r0,r0\\).*
56 .*fmov\tfr0,fr1.*
57 .*fldi0\tfr0.*
58 .*fldi1\tfr0.*
59 .*$prompt $" { pass "fp_move_and_load_tests" }
60 -re "$prompt $" { fail "fp_move_and_load_tests" }
61 timeout { fail "(timeout) fp_move_and_load_tests" }
62 }
63 }
64
65 proc all_fp_arithmetic_tests { } {
66 global prompt
67 global hex
68 global decimal
69
70 send_gdb "x/13i fp_arithmetic_tests\n"
71 expect {
72 -re "
73 .*fadd\tfr0,fr1.*
74 .*fsub\tfr0,fr1.*
75 .*fmul\tfr0,fr1.*
76 .*fdiv\tfr0,fr1.*
77 .*fmac\tfr0,fr0,fr1.*
78 .*fcmp/eq\tfr0,fr1.*
79 .*fcmp/gt\tfr0,fr1.*
80 .*ftst/nan\tfr0.*
81 .*fneg\tfr0.*
82 .*fabs\tfr0.*
83 .*fsqrt\tfr0.*
84 .*float\tfpul,fr0.*
85 .*ftrc\tfr0,fpul.*
86 .*$prompt $" { pass "fp_arithmetic_tests" }
87 -re "$prompt $" { fail "fp_arithmetic_tests" }
88 timeout { fail "(timeout) fp_arithmetic_tests" }
89 }
90 }
91
92 proc all_fp_misc_tests { } {
93 global prompt
94 global hex
95 global decimal
96
97 send_gdb "x/10i fp_misc_tests\n"
98 expect {
99 -re "
100 .*fsts\tfpul,fr0.*
101 .*flds\tfr0,fpul.*
102 .*lds\tr3,fpul.*
103 .*lds\\.l\t@r3\\+,fpul.*
104 .*lds\tr3,fpscr.*
105 .*lds\\.l\t@r3\\+,fpscr.*
106 .*sts\tfpul,r3.*
107 .*sts\\.l\tfpul,@-r3.*
108 .*sts\tfpscr,r3.*
109 .*sts\\.l\tfpscr,@-r3.*
110 .*$prompt $" { pass "fp_misc_tests" }
111 -re "$prompt $" { fail "fp_misc_tests" }
112 timeout { fail "(timeout) fp_misc_tests" }
113 }
114 }
115
116 gdb_exit
117 gdb_start
118 gdb_reinitialize_dir $srcdir/$subdir
119 gdb_load $binfile
120
121 all_fp_move_and_load_tests
122 all_fp_arithmetic_tests
123 all_fp_misc_tests
124