2010-11-30 Tobias Burnus <burnus@net-b.de>
[official-gcc.git] / gcc / testsuite / gfortran.dg / allocate_alloc_opt_4.f90
blob89052ef16b9aa7a64863a7dc5907c4d0f207d43b
1 ! { dg-do compile }
2 program a
4 implicit none
6 integer n, m(3,3)
7 integer(kind=8) k
8 integer, allocatable :: i(:), j(:)
9 real, allocatable :: x(:)
11 n = 42
12 m = n
13 k = 1_8
15 allocate(i(4), source=42, source=n) ! { dg-error "Redundant SOURCE tag found" }
17 allocate(integer(4) :: i(4), source=n) ! { dg-error "conflicts with the typespec" }
19 allocate(i(4), j(n), source=n) ! { dg-error "requires only a single entity" }
21 allocate(x(4), source=n) ! { dg-error "type incompatible with" }
23 allocate(i(4), source=m) ! { dg-error "must be scalar or have the same rank" }
25 allocate(i(4), source=k) ! { dg-error "shall have the same kind type" }
27 end program a