]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.arch/i386-sse.exp
Copyright updates for 2007.
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.arch / i386-sse.exp
CommitLineData
6aba47ca 1# Copyright 2004, 2005, 2007 Free Software Foundation, Inc.
83ecb59f
JB
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@gnu.org
19
20# This file is part of the gdb testsuite.
21
22if $tracelevel {
23 strace $tracelevel
24}
25
26set prms_id 0
27set bug_id 0
28
29if ![istarget "i?86-*-*"] then {
30 verbose "Skipping i386 SSE tests."
31 return
32}
33
34set testfile "i386-sse"
35set srcfile ${testfile}.c
36set binfile ${objdir}/${subdir}/${testfile}
b1a9c082
MK
37
38if [get_compiler_info ${binfile}] {
39 return -1
40}
41
42set additional_flags ""
43if [test_compiler_info gcc*] {
44 set additional_flags "additional_flags=-msse"
45}
46
47if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug $additional_flags]] != "" } {
4ac6f39d
MC
48 unsupported "compiler does not support SSE"
49 return
83ecb59f
JB
50}
51
52gdb_exit
53gdb_start
54gdb_reinitialize_dir $srcdir/$subdir
55gdb_load ${binfile}
56
57if ![runto_main] then {
58 gdb_suppress_tests
59}
60
61send_gdb "print have_sse ()\r"
62gdb_expect {
63 -re ".. = 1\r\n$gdb_prompt " {
64 pass "check whether processor supports SSE"
65 }
66 -re ".. = 0\r\n$gdb_prompt " {
67 verbose "processor does not support SSE; skipping SSE tests"
68 return
69 }
70 -re ".*$gdb_prompt $" {
71 fail "check whether processor supports SSE"
72 }
73 timeout {
74 fail "check whether processor supports SSE (timeout)"
75 }
76}
77
78gdb_test "break [gdb_get_line_number "first breakpoint here"]" \
79 "Breakpoint .* at .*i386-sse.c.*" \
80 "set breakpoint in main"
81gdb_continue_to_breakpoint "continue to first breakpoint in main"
82
83foreach r {0 1 2 3 4 5 6 7} {
84 gdb_test "print \$xmm$r.v4_float" \
8d5df71a 85 ".. = \\{$r, $r.25, $r.5, $r.75\\}.*" \
83ecb59f
JB
86 "check contents of %xmm$r"
87}
88
89foreach r {0 1 2 3 4 5 6 7} {
90 gdb_test "set var \$xmm$r.v4_float\[0\] = $r + 10" "" "set %xmm$r"
91}
92
93gdb_test "break [gdb_get_line_number "second breakpoint here"]" \
94 "Breakpoint .* at .*i386-sse.c.*" \
95 "set breakpoint in main"
96gdb_continue_to_breakpoint "continue to second breakpoint in main"
97
98foreach r {0 1 2 3 4 5 6 7} {
99 gdb_test "print data\[$r\]" \
8d5df71a 100 ".. = \\{f = \\{[expr $r + 10], $r.25, $r.5, $r.75\\}\\}.*" \
83ecb59f
JB
101 "check contents of data\[$r\]"
102}