Rename gdb/ChangeLog to gdb/ChangeLog-2021
[binutils-gdb.git] / gdb / testsuite / gdb.fortran / rank.f90
blob66de2bb9ed76f56102d6280345dd76589a8688a5
1 ! Copyright 2021 Free Software Foundation, Inc.
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.
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.
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/>.
17 ! Start of test program.
19 program test
21 ! Things to ask questions about.
22 integer, target :: array_1d (8:10) = 0
23 integer, target :: array_2d (1:3, 4:7) = 0
24 integer :: other_1d (4:5, -3:-1, 99:101) = 0
25 integer, pointer :: array_1d_p (:) => null ()
26 integer, pointer :: array_2d_p (:,:) => null ()
28 integer :: an_integer = 0
29 real :: a_real = 0.0
31 ! The start of the tests.
32 call test_rank (rank (array_1d))
33 call test_rank (rank (array_2d))
34 call test_rank (rank (other_1d))
35 call test_rank (rank (array_1d_p))
36 call test_rank (rank (array_2d_p))
38 array_1d_p => array_1d
39 array_2d_p => array_2d
41 call test_rank (rank (array_1d_p))
42 call test_rank (rank (array_2d_p))
44 call test_rank (rank (an_integer))
45 call test_rank (rank (a_real))
47 print *, "" ! Final Breakpoint
49 contains
51 subroutine test_rank (answer)
52 integer :: answer
54 print *,answer ! Test Breakpoint
55 end subroutine test_rank
57 end program test