]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.opt/clobbered-registers-O2.exp
Update copyright year range in header of all files managed by GDB
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.opt / clobbered-registers-O2.exp
CommitLineData
213516ef 1# Copyright 2007-2023 Free Software Foundation, Inc.
5876dc88
LM
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
edb3359d 5# the Free Software Foundation; either version 3 of the License, or
5876dc88
LM
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
edb3359d 14# along with this program. If not, see <http://www.gnu.org/licenses/>.
5876dc88
LM
15#
16# This file is part of the gdb testsuite.
17
5876dc88
LM
18# Test displaying call clobbered registers in optimized binaries.
19# GDB should not show incorrect values.
20
9e9f0d02 21standard_testfile .c -2.c -3.c
5876dc88 22
9e9f0d02
TV
23if {[prepare_for_testing "failed to prepare" $testfile \
24 [list $srcfile $srcfile2 $srcfile3] \
efc9d70a
TT
25 {debug optimize=-O2 nowarnings}]} {
26 return -1
5876dc88
LM
27}
28
f50c72da 29if {![runto start_sequence]} {
5876dc88
LM
30 return
31}
32
cdc7edd7 33gdb_test "frame 1" "#1.*in gen_movsd.*" "backtracing"
5876dc88
LM
34
35gdb_test_multiple "print operand0" "print operand0" {
585fdaa1 36 -re "\\\$$decimal = <optimized out>\r\n$gdb_prompt $" { pass "print operand0"}
5876dc88
LM
37 -re "$hex\r\n$gdb_prompt $" { gdb_test "print *operand0" "13" "print operand0" }
38}
39
40gdb_test_multiple "print operand1" "print operand1" {
585fdaa1 41 -re "\\\$$decimal = <optimized out>\r\n$gdb_prompt $" { pass "print operand1"}
5876dc88
LM
42 -re "$hex\r\n$gdb_prompt $" { gdb_test "print *operand1" "14" "print operand1" }
43}
44