]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/testsuite/gdb.opt/fortran-string.exp
Update copyright year range in header of all files managed by GDB
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.opt / fortran-string.exp
1 # Copyright 2009-2024 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 <http://www.gnu.org/licenses/> .
15
16 # Test GDB can cope with Fortran strings having their length present in a CPU
17 # register. With -O0 the string length is passed on the stack. To make this
18 # test meaningful the follow assertion should pass. It is not being checked
19 # here as the "_s" symbol is compiler dependent:
20 # (gdb) info address _s
21 # Symbol "_s" is a variable in register XX.
22
23 standard_testfile .f90
24
25 if { [prepare_for_testing "prepare for testing" ${testfile} ${srcfile} \
26 {debug f90 additional_flags=-O1}] } {
27 return -1
28 }
29
30 if {![runto f]} {
31 return
32 }
33
34 gdb_test_no_output "set print frame-arguments all"
35 gdb_test "frame" ".*s='foo'.*"
36 gdb_test "ptype s" "type = character \\(3\\)"
37 gdb_test "p s" "\\$\[0-9\]* = 'foo'"