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

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gdb/] [gdb-6.8/] [gdb/] [testsuite/] [gdb.arch/] [iwmmxt-regs.exp] - Blame information for rev 25

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 25 jlechner
# Copyright 2007, 2008 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
 
17
# Tests for ARM iWMMXt register setting and fetching.
18
 
19
if ![istarget "arm*-*-*"] then {
20
    verbose "Skipping iWMMXt register tests."
21
    return
22
}
23
 
24
set testfile "iwmmxt-regs"
25
set binfile ${objdir}/${subdir}/${testfile}
26
set src1 ${srcdir}/${subdir}/${testfile}.c
27
 
28
# Try to compile the test case.  If we can't, assume this is not an
29
# iWMMXt toolchain and bail out.
30
if { [gdb_compile ${src1} ${binfile} executable {quiet debug}] != "" } {
31
    verbose "Skipping iWMMXt register tests."
32
    return
33
}
34
 
35
gdb_start
36
gdb_reinitialize_dir $srcdir/$subdir
37
gdb_load ${binfile}
38
 
39
#
40
# Run to `main' where we begin our tests.
41
#
42
 
43
if ![runto_main] then {
44
    gdb_suppress_tests
45
}
46
 
47
# Set all the registers to arbitrary values.
48
for {set i 0} {$i < 16} {incr i 1} {
49
    gdb_test "set \$wR$i.u64 = ((${i}LL << 32) | ${i})" "" "set reg wR$i"
50
}
51
gdb_test "set \$wCSSF = 300" "" "set reg wCSSF"
52
gdb_test "set \$wCASF = 200" "" "set reg wCASF"
53
for {set i 0} {$i < 4} {incr i 1} {
54
    gdb_test "set \$wCGR$i = 100 + $i" "" "set reg wCGR$i"
55
}
56
 
57
# See if the sets stuck.
58
gdb_test "next" ".*write_regs.*" "next over read_regs"
59
 
60
for {set i 0} {$i < 16} {incr i 1} {
61
    gdb_test "p \$wR$i.u64 == ((${i}LL << 32) | ${i})" "\\\$$decimal = 1" "test reg wR$i"
62
}
63
# Don't test wCSSF.
64
gdb_test "p \$wCASF" "\\\$$decimal = 200" "test reg wCASF"
65
for {set i 0} {$i < 4} {incr i 1} {
66
    gdb_test "p \$wCGR$i == 100 + $i" "\\\$$decimal = 1" "test reg wCGR$i"
67
}
68
 
69
# Also verify the copies read by the target.
70
for {set i 0} {$i < 16} {incr i 1} {
71
    gdb_test "p regs\[$i\] == ((${i}LL << 32) | ${i})" "\\\$$decimal = 1" "test stored wR$i"
72
}
73
# Don't test wcssf.
74
gdb_test "p control_regs\[1\]" "\\\$$decimal = 200" "test stored wCASF"
75
for {set i 0} {$i < 4} {incr i 1} {
76
    gdb_test "p control_regs\[$i + 2\] == 100 + $i" "\\\$$decimal = 1" "test stored wCGR$i"
77
}

powered by: WebSVN 2.1.0

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