OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gdb-7.2/] [gdb-7.2-or32-1.0rc3/] [gdb/] [testsuite/] [gdb.arch/] [i386-sse.exp] - Blame information for rev 579

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 330 jeremybenn
# Copyright 2004, 2005, 2007, 2008, 2009, 2010 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 .
15
 
16
# Please email any bugs, comments, and/or additions to this file to:
17
# bug-gdb@gnu.org
18
 
19
# This file is part of the gdb testsuite.
20
 
21
if $tracelevel {
22
    strace $tracelevel
23
}
24
 
25
 
26
if { ![istarget i?86-*-*] && ![istarget x86_64-*-* ] } {
27
    verbose "Skipping x86 SSE tests."
28
    return
29
}
30
 
31
set testfile "i386-sse"
32
set srcfile ${testfile}.c
33
set binfile ${objdir}/${subdir}/${testfile}
34
 
35
if [get_compiler_info ${binfile}] {
36
    return -1
37
}
38
 
39
set additional_flags ""
40
if [test_compiler_info gcc*] {
41
    set additional_flags "additional_flags=-msse"
42
}
43
 
44
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug $additional_flags]] != "" } {
45
    unsupported "compiler does not support SSE"
46
    return
47
}
48
 
49
gdb_exit
50
gdb_start
51
gdb_reinitialize_dir $srcdir/$subdir
52
gdb_load ${binfile}
53
 
54
if ![runto_main] then {
55
    gdb_suppress_tests
56
}
57
 
58
send_gdb "print have_sse ()\r"
59
gdb_expect {
60
    -re ".. = 1\r\n$gdb_prompt " {
61
        pass "check whether processor supports SSE"
62
    }
63
    -re ".. = 0\r\n$gdb_prompt " {
64
        verbose "processor does not support SSE; skipping SSE tests"
65
        return
66
    }
67
    -re ".*$gdb_prompt $" {
68
        fail "check whether processor supports SSE"
69
    }
70
    timeout {
71
        fail "check whether processor supports SSE (timeout)"
72
    }
73
}
74
 
75
gdb_test "break [gdb_get_line_number "first breakpoint here"]" \
76
         "Breakpoint .* at .*i386-sse.c.*" \
77
         "set first breakpoint in main"
78
gdb_continue_to_breakpoint "continue to first breakpoint in main"
79
 
80
if [istarget i?86-*-*] {
81
    set nr_regs 8
82
} else {
83
    set nr_regs 16
84
}
85
 
86
for { set r 0 } { $r < $nr_regs } { incr r } {
87
    gdb_test "print \$xmm$r.v4_float" \
88
        ".. = \\{$r, $r.25, $r.5, $r.75\\}.*" \
89
        "check float contents of %xmm$r"
90
    gdb_test "print \$xmm$r.v16_int8" \
91
        ".. = \\{(-?\[0-9\]+, ){15}-?\[0-9\]+\\}.*" \
92
        "check int8 contents of %xmm$r"
93
}
94
 
95
for { set r 0 } { $r < $nr_regs } { incr r } {
96
    gdb_test "set var \$xmm$r.v4_float\[0\] = $r + 10" "" "set %xmm$r"
97
}
98
 
99
gdb_test "break [gdb_get_line_number "second breakpoint here"]" \
100
         "Breakpoint .* at .*i386-sse.c.*" \
101
         "set second breakpoint in main"
102
gdb_continue_to_breakpoint "continue to second breakpoint in main"
103
 
104
for { set r 0 } { $r < $nr_regs } { incr r } {
105
    gdb_test "print data\[$r\]" \
106
        ".. = \\{f = \\{[expr $r + 10], $r.25, $r.5, $r.75\\}\\}.*" \
107
        "check contents of data\[$r\]"
108
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.