diff options
Diffstat (limited to 'gcc/testsuite/gfortran.dg/allocate_alloc_opt_4.f90')
-rw-r--r-- | gcc/testsuite/gfortran.dg/allocate_alloc_opt_4.f90 | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/allocate_alloc_opt_4.f90 b/gcc/testsuite/gfortran.dg/allocate_alloc_opt_4.f90 new file mode 100644 index 000000000..89052ef16 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/allocate_alloc_opt_4.f90 @@ -0,0 +1,27 @@ +! { dg-do compile } +program a + + implicit none + + integer n, m(3,3) + integer(kind=8) k + integer, allocatable :: i(:), j(:) + real, allocatable :: x(:) + + n = 42 + m = n + k = 1_8 + + allocate(i(4), source=42, source=n) ! { dg-error "Redundant SOURCE tag found" } + + allocate(integer(4) :: i(4), source=n) ! { dg-error "conflicts with the typespec" } + + allocate(i(4), j(n), source=n) ! { dg-error "requires only a single entity" } + + allocate(x(4), source=n) ! { dg-error "type incompatible with" } + + allocate(i(4), source=m) ! { dg-error "must be scalar or have the same rank" } + + allocate(i(4), source=k) ! { dg-error "shall have the same kind type" } + +end program a |