1! { dg-do compile }
2! { dg-options "-std=f2003" }
3program a
4
5  implicit none
6
7  integer n, m(3,3)
8  integer(kind=8) k
9  integer, allocatable :: i(:), j(:)
10  real, allocatable :: x(:)
11
12  n = 42
13  m = n
14  k = 1_8
15
16  allocate(i(4), source=42, source=n) ! { dg-error "Redundant SOURCE tag found" }
17
18  allocate(integer(4) :: i(4), source=n) ! { dg-error "conflicts with the typespec" }
19
20  allocate(i(4), j(n), source=n) ! { dg-error "Fortran 2008: SOURCE tag at .1. with more than a single allocate object" }
21
22  allocate(x(4), source=n) ! { dg-error "type incompatible with" }
23
24  allocate(i(4), source=m) ! { dg-error "must be scalar or have the same rank" }
25
26  allocate(i(4), source=k) ! { dg-error "shall have the same kind type" }
27
28end program a
29