Commit | Line | Data |
---|---|---|
88b9d363 | 1 | ! Copyright 2021-2022 Free Software Foundation, Inc. |
e14816a8 AB |
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 | ! | |
17 | ! Start of test program. | |
18 | ! | |
19 | program test | |
20 | ||
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 () | |
27 | ||
28 | integer :: an_integer = 0 | |
29 | real :: a_real = 0.0 | |
30 | ||
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)) | |
37 | ||
38 | array_1d_p => array_1d | |
39 | array_2d_p => array_2d | |
40 | ||
41 | call test_rank (rank (array_1d_p)) | |
42 | call test_rank (rank (array_2d_p)) | |
43 | ||
44 | call test_rank (rank (an_integer)) | |
45 | call test_rank (rank (a_real)) | |
46 | ||
47 | print *, "" ! Final Breakpoint | |
48 | ||
49 | contains | |
50 | ||
51 | subroutine test_rank (answer) | |
52 | integer :: answer | |
53 | ||
54 | print *,answer ! Test Breakpoint | |
55 | end subroutine test_rank | |
56 | ||
57 | end program test |