]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/testsuite/gdb.arch/powerpc-prologue.exp
Copyright updates for 2007.
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.arch / powerpc-prologue.exp
1 # Copyright 2006, 2007 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 # Test PowerPC prologue analyzer.
18
19 # Do not run on AIX (where we won't be able to build the tests without
20 # some surgery) or on PowerPC64 (ditto, dot symbols).
21 if {[istarget *-*-aix*] || ![istarget "powerpc-*-*"]} then {
22 verbose "Skipping PowerPC prologue tests."
23 return
24 }
25
26 set testfile "powerpc-prologue"
27 set srcfile ${testfile}.c
28 set binfile ${objdir}/${subdir}/${testfile}
29
30 # Don't use "debug", so that we don't have line information for the assembly
31 # fragments.
32 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {}] != "" } {
33 untested "PowerPC prologue tests"
34 return -1
35 }
36
37
38 gdb_exit
39 gdb_start
40 gdb_reinitialize_dir $srcdir/$subdir
41 gdb_load ${binfile}
42
43 #
44 # Run to `main' where we begin our tests.
45 #
46
47 if ![runto_main] then {
48 gdb_suppress_tests
49 }
50
51 # Testcase for PIC prologue.
52
53 gdb_test "continue" "Program received signal SIGTRAP.*" "continue to PIC"
54
55 gdb_test "backtrace 10" \
56 "#0\[ \t\]*$hex in gdb2029.*\r\n#1\[ \t\]*$hex in main.*" \
57 "backtrace in PIC"
58
59 gdb_test "info frame" \
60 ".*Saved registers:.*r30 at.*r31 at.*pc at.*lr at.*" \
61 "saved registers in PIC"