1# Copyright (C) 1992, 1997 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 22if $tracelevel then { 23 strace $tracelevel 24} 25 26if ![istarget "sh3*-*-*"] { 27 verbose "Tests ignored for all but sh3 based targets." 28 return 29} 30 31set prms_id 0 32set bug_id 0 33 34set testfile "sh3" 35set srcfile ${srcdir}/${subdir}/${testfile}.s 36set binfile ${objdir}/${subdir}/${testfile} 37if { [gdb_compile "${srcfile}" "${binfile}" executable ""] != "" } { 38 gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." 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 124