From 1bc5aee63eb72b341f506ad058502cd0361f0d10 Mon Sep 17 00:00:00 2001 From: Ben Cheng Date: Tue, 25 Mar 2014 22:37:19 -0700 Subject: Initial checkin of GCC 4.9.0 from trunk (r208799). Change-Id: I48a3c08bb98542aa215912a75f03c0890e497dba --- .../testsuite/gfortran.dg/allocate_alloc_opt_4.f90 | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 gcc-4.9/gcc/testsuite/gfortran.dg/allocate_alloc_opt_4.f90 (limited to 'gcc-4.9/gcc/testsuite/gfortran.dg/allocate_alloc_opt_4.f90') diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/allocate_alloc_opt_4.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/allocate_alloc_opt_4.f90 new file mode 100644 index 000000000..ee6c36359 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gfortran.dg/allocate_alloc_opt_4.f90 @@ -0,0 +1,28 @@ +! { dg-do compile } +! { dg-options "-std=f2003" } +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 "Fortran 2008: SOURCE tag at .1. with more than a single allocate object" } + + 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 -- cgit v1.2.3