OSDN Git Service

Add NIOS2 support. Code from SourceyG++.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / allocate_alloc_opt_4.f90
1 ! { dg-do compile }
2 program a
3
4   implicit none
5
6   integer n, m(3,3)
7   integer(kind=8) k
8   integer, allocatable :: i(:), j(:)
9   real, allocatable :: x(:)
10
11   n = 42
12   m = n
13   k = 1_8
14
15   allocate(i(4), source=42, source=n) ! { dg-error "Redundant SOURCE tag found" }
16
17   allocate(integer(4) :: i(4), source=n) ! { dg-error "conflicts with the typespec" }
18
19   allocate(i(4), j(n), source=n) ! { dg-error "requires only a single entity" }
20
21   allocate(x(4), source=n) ! { dg-error "type incompatible with" }
22
23   allocate(i(4), source=m) ! { dg-error "must be scalar or have the same rank" }
24
25   allocate(i(4), source=k) ! { dg-error "shall have the same kind type" }
26
27 end program a