GDB copyright headers update after running GDB's copyright.py script.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.fortran / vla.f90
CommitLineData
618f726f 1! Copyright 2015-2016 Free Software Foundation, Inc.
3f2f83dd
KB
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
16program vla
17 real, target, allocatable :: vla1 (:, :, :)
18 real, target, allocatable :: vla2 (:, :, :)
19 real, target, allocatable :: vla3 (:, :)
20 real, pointer :: pvla (:, :, :)
21 logical :: l
22
23 allocate (vla1 (10,10,10)) ! vla1-init
24 l = allocated(vla1)
25
26 allocate (vla2 (1:7,42:50,13:35)) ! vla1-allocated
27 l = allocated(vla2)
28
29 vla1(:, :, :) = 1311 ! vla2-allocated
30 vla1(3, 6, 9) = 42
31 vla1(1, 3, 8) = 1001
32 vla1(6, 2, 7) = 13
33
34 vla2(:, :, :) = 1311 ! vla1-filled
35 vla2(5, 45, 20) = 42
36
37 pvla => vla1 ! vla2-filled
38 l = associated(pvla)
39
40 pvla => vla2 ! pvla-associated
41 l = associated(pvla)
42 pvla(5, 45, 20) = 1
43 pvla(7, 45, 14) = 2
44
45 pvla => null() ! pvla-re-associated
46 l = associated(pvla)
47
48 deallocate (vla1) ! pvla-deassociated
49 l = allocated(vla1)
50
51 deallocate (vla2) ! vla1-deallocated
52 l = allocated(vla2)
53
54 allocate (vla3 (2,2)) ! vla2-deallocated
55 vla3(:,:) = 13
56end program vla
This page took 0.044768 seconds and 4 git commands to generate.