Rename gdb/ChangeLog to gdb/ChangeLog-2021
[binutils-gdb.git] / gdb / testsuite / gdb.fortran / allocated.f90
blobcfca2c809aac2a473db2ff5cc548341cc9549d80
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 integer, allocatable :: array (:, :)
22 logical is_allocated
24 is_allocated = allocated (array)
25 print *, is_allocated ! Breakpoint 1
27 ! Allocate or associate any variables as needed.
28 allocate (array (-5:4, -2:7))
30 is_allocated = allocated (array)
31 print *, is_allocated ! Breakpoint 2
33 deallocate (array)
35 is_allocated = allocated (array)
36 print *, is_allocated ! Breakpoint 3
38 allocate (array (3:8, 2:7))
40 is_allocated = allocated (array)
41 print *, is_allocated ! Breakpoint 4
43 ! All done. Deallocate.
44 deallocate (array)
46 is_allocated = allocated (array)
47 print *, is_allocated ! Breakpoint 5
49 end program test