binutils-gdb/gdb/testsuite/gdb.fortran/entry-point.exp
Andrew Burgess 1d506c26d9 Update copyright year range in header of all files managed by GDB
This commit is the result of the following actions:

  - Running gdb/copyright.py to update all of the copyright headers to
    include 2024,

  - Manually updating a few files the copyright.py script told me to
    update, these files had copyright headers embedded within the
    file,

  - Regenerating gdbsupport/Makefile.in to refresh it's copyright
    date,

  - Using grep to find other files that still mentioned 2023.  If
    these files were updated last year from 2022 to 2023 then I've
    updated them this year to 2024.

I'm sure I've probably missed some dates.  Feel free to fix them up as
you spot them.
2024-01-12 15:49:57 +00:00

84 lines
2.9 KiB
Text

# Copyright 2023-2024 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Test Fortran entry points for subroutines.
require allow_fortran_tests
standard_testfile .f90
load_lib "fortran.exp"
if { [prepare_for_testing $testfile.exp $testfile $srcfile {debug f90}] } {
return -1
}
if { ![fortran_runto_main] } {
untested "could not run to main"
return -1
}
# Test if we can set a breakpoint via the entry-point name.
set entry_point_name "foo"
gdb_breakpoint $entry_point_name
gdb_continue_to_breakpoint "continue to breakpoint: $entry_point_name" \
".*entry foo\\(J,K,L,I1\\).*"
gdb_test "print j" "= 11" "print j, entered via $entry_point_name"
gdb_test "print k" "= 22" "print k, entered via $entry_point_name"
gdb_test "print l" "= 33" "print l, entered via $entry_point_name"
gdb_test "print i1" "= 44" "print i1, entered via $entry_point_name"
gdb_test "info args" \
[multi_line "j = 11" \
"k = 22" \
"l = 33" \
"i1 = 44"] \
"info args, entered via $entry_point_name"
# Test if we can set a breakpoint via the function name.
set entry_point_name "bar"
gdb_breakpoint $entry_point_name
gdb_continue_to_breakpoint "continue to breakpoint: $entry_point_name" \
".*subroutine bar\\(I,J,K,I1\\).*"
gdb_test "print i" "= 444" "print i, entered via $entry_point_name"
gdb_test "print j" "= 555" "print j, entered via $entry_point_name"
gdb_test "print k" "= 666" "print k, entered via $entry_point_name"
gdb_test "print i1" "= 777" "print i1, entered via $entry_point_name"
# Test a second entry point.
set entry_point_name "foobar"
gdb_breakpoint $entry_point_name
gdb_continue_to_breakpoint "continue to breakpoint: $entry_point_name" \
".* entry foobar\\(J\\).*"
gdb_test "print j" "= 1" "print j, entered via $entry_point_name"
gdb_test "info args" "j = 1" "info args, entered via $entry_point_name"
# Test breaking at the entrypoint defined inside the module mod via its
# scoped name.
set entry_point_name "mod::mod_foo"
# GCC moves subroutines with entry points out of the module scope into the
# compile unit scope.
if {[test_compiler_info {gcc-*}]} {
setup_xfail "gcc/105272" "*-*-*"
}
gdb_breakpoint $entry_point_name
if {[test_compiler_info {gcc-*}]} {
setup_xfail "gcc/105272" "*-*-*"
}
gdb_continue_to_breakpoint "continue to breakpoint: $entry_point_name" \
".* entry mod_foo\\(\\).*"