OLD | NEW |
1 # Copyright 2007-2012 Free Software Foundation, Inc. | 1 # Copyright 2007-2012 Free Software Foundation, Inc. |
2 # | 2 # |
3 # This program is free software; you can redistribute it and/or modify | 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 | 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 | 5 # the Free Software Foundation; either version 3 of the License, or |
6 # (at your option) any later version. | 6 # (at your option) any later version. |
7 # | 7 # |
8 # This program is distributed in the hope that it will be useful, | 8 # This program is distributed in the hope that it will be useful, |
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
11 # GNU General Public License for more details. | 11 # GNU General Public License for more details. |
12 # | 12 # |
13 # You should have received a copy of the GNU General Public License | 13 # You should have received a copy of the GNU General Public License |
14 # along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
15 # | 15 # |
16 # This file is part of the gdb testsuite. | 16 # This file is part of the gdb testsuite. |
17 | 17 |
18 if $tracelevel then { | |
19 strace $tracelevel | |
20 } | |
21 | |
22 # Test displaying call clobbered registers in optimized binaries. | 18 # Test displaying call clobbered registers in optimized binaries. |
23 # GDB should not show incorrect values. | 19 # GDB should not show incorrect values. |
24 | 20 |
25 set testfile clobbered-registers-O2 | 21 standard_testfile |
26 set srcfile ${testfile}.c | |
27 set binfile ${objdir}/${subdir}/${testfile} | |
28 | 22 |
29 # What compiler are we using? | 23 # What compiler are we using? |
30 # | 24 # |
31 if [get_compiler_info ${binfile}] { | 25 if [get_compiler_info] { |
32 return -1 | 26 return -1 |
33 } | 27 } |
34 | 28 |
35 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [con
cat debug optimize=-O2 nowarnings]] != "" } { | 29 if {[prepare_for_testing $testfile.exp $testfile $srcfile \ |
36 untested clobbered-registers-O2.exp | 30 » {debug optimize=-O2 nowarnings}]} { |
37 return -1 | 31 return -1 |
38 } | 32 } |
39 | 33 |
40 # use this to debug: | |
41 #log_user 1 | |
42 | |
43 gdb_exit | |
44 gdb_start | |
45 gdb_reinitialize_dir $srcdir/$subdir | |
46 gdb_load ${binfile} | |
47 | |
48 if { ![runto start_sequence] } then { | 34 if { ![runto start_sequence] } then { |
49 fail "run to start_sequence" | 35 fail "run to start_sequence" |
50 return | 36 return |
51 } | 37 } |
52 | 38 |
53 gdb_test "frame 1" "#1.*in gen_movsd.*" "Backtracing" | 39 gdb_test "frame 1" "#1.*in gen_movsd.*" "Backtracing" |
54 | 40 |
55 gdb_test_multiple "print operand0" "print operand0" { | 41 gdb_test_multiple "print operand0" "print operand0" { |
56 -re "\\\$$decimal = <optimized out>\r\n$gdb_prompt $" { pass "print operand0
"} | 42 -re "\\\$$decimal = <optimized out>\r\n$gdb_prompt $" { pass "print operand0
"} |
57 -re "$hex\r\n$gdb_prompt $" { gdb_test "print *operand0" "13" "print operand
0" } | 43 -re "$hex\r\n$gdb_prompt $" { gdb_test "print *operand0" "13" "print operand
0" } |
58 } | 44 } |
59 | 45 |
60 gdb_test_multiple "print operand1" "print operand1" { | 46 gdb_test_multiple "print operand1" "print operand1" { |
61 -re "\\\$$decimal = <optimized out>\r\n$gdb_prompt $" { pass "print operand1
"} | 47 -re "\\\$$decimal = <optimized out>\r\n$gdb_prompt $" { pass "print operand1
"} |
62 -re "$hex\r\n$gdb_prompt $" { gdb_test "print *operand1" "14" "print operand
1" } | 48 -re "$hex\r\n$gdb_prompt $" { gdb_test "print *operand1" "14" "print operand
1" } |
63 } | 49 } |
64 | 50 |
OLD | NEW |