Merge from mainline (165734:167278).
[official-gcc/graphite-test-results.git] / gcc / testsuite / gfortran.dg / allocate_with_typespec_1.f90
blob945a80e4afdd0f955f4ac62342f2d84fa5121d11
1 ! { dg-do compile }
3 ! Allocation of arrays with a type-spec specification with implicit none.
5 subroutine implicit_none_test1
7 implicit none
9 real, allocatable :: x(:)
10 real(4), allocatable :: x4(:)
11 real(8), allocatable :: x8(:)
12 double precision, allocatable :: d1(:)
13 doubleprecision, allocatable :: d2(:)
14 character, allocatable :: c1(:)
15 character(len=4), allocatable :: c2(:)
17 type a
18 integer mytype
19 end type a
21 type(a), allocatable :: b(:)
23 allocate(real :: x(1))
24 allocate(real(4) :: x4(1))
25 allocate(real(8) :: x8(1))
26 allocate(double precision :: d1(1))
27 allocate(doubleprecision :: d2(1))
28 allocate(character :: c1(1))
29 allocate(character(len=4) :: c2(1))
30 allocate(a :: b(1))
32 end subroutine implicit_none_test1
34 ! Allocation of a scalar with a type-spec specification with implicit none
36 subroutine implicit_none_test2
38 implicit none
40 real, allocatable :: x
41 real(4), allocatable :: x4
42 real(8), allocatable :: x8
43 double precision, allocatable :: d1
44 doubleprecision, allocatable :: d2
45 character, allocatable :: c1
46 character(len=4), allocatable :: c2
48 type a
49 integer mytype
50 end type a
52 type(a), allocatable :: b
54 allocate(real :: x)
55 allocate(real(4) :: x4)
56 allocate(real(8) :: x8)
57 allocate(double precision :: d1)
58 allocate(doubleprecision :: d2)
59 allocate(character :: c1)
60 allocate(character(len=4) :: c2)
61 allocate(a :: b)
63 end subroutine implicit_none_test2
65 ! Allocation of arrays with a type-spec specification with implicit none.
67 subroutine implicit_test3
69 real, allocatable :: x(:)
70 real(4), allocatable :: x4(:)
71 real(8), allocatable :: x8(:)
72 double precision, allocatable :: d1(:)
73 doubleprecision, allocatable :: d2(:)
74 character, allocatable :: c1(:)
75 character(len=4), allocatable :: c2(:)
77 type a
78 integer mytype
79 end type a
81 type(a), allocatable :: b(:)
83 allocate(real :: x(1))
84 allocate(real(4) :: x4(1))
85 allocate(real(8) :: x8(1))
86 allocate(double precision :: d1(1))
87 allocate(doubleprecision :: d2(1))
88 allocate(character :: c1(1))
89 allocate(character(len=4) :: c2(1))
90 allocate(a :: b(1))
92 end subroutine implicit_test3
94 ! Allocation of a scalar with a type-spec specification without implicit none
96 subroutine implicit_test4
98 real, allocatable :: x
99 real(4), allocatable :: x4
100 real(8), allocatable :: x8
101 double precision, allocatable :: d1
102 doubleprecision, allocatable :: d2
103 character, allocatable :: c1
104 character(len=4), allocatable :: c2
106 type a
107 integer mytype
108 end type a
110 type(a), allocatable :: b
112 allocate(real :: x)
113 allocate(real(4) :: x4)
114 allocate(real(8) :: x8)
115 allocate(double precision :: d1)
116 allocate(doubleprecision :: d2)
117 allocate(character :: c1)
118 allocate(character(len=4) :: c2)
119 allocate(a :: b)
121 end subroutine implicit_test4