xref: /netbsd-src/external/gpl3/gdb/dist/gdb/testsuite/gdb.fortran/entry-point.f90 (revision 8e33eff89e26cf71871ead62f0d5063e1313c33a)
1! Copyright 2023-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
16module mod
17implicit none
18
19contains
20  subroutine mod_bar
21    integer :: I = 3
22
23    goto 100
24
25    entry mod_foo
26    I = 33
27
28100 print *, I
29  end subroutine mod_bar
30end module mod
31
32
33subroutine bar(I,J,K,I1)
34  integer :: I,J,K,L,I1
35  integer :: A
36  real :: C
37
38  A = 0
39  C = 0.0
40
41  A = I + K + I1
42  goto 300
43
44  entry foo(J,K,L,I1)
45  A = J + K + L + I1
46
47200 C = J
48  goto 300
49
50  entry foobar(J)
51  goto 200
52
53300 A = C + 1
54  C = J * 1.5
55
56  return
57end subroutine
58
59program TestEntryPoint
60  use mod
61
62  call foo(11,22,33,44)
63  call bar(444,555,666,777)
64  call foobar(1)
65
66  call mod_foo()
67end program TestEntryPoint
68