2011-05-23 Tom de Vries <tom@codesourcery.com>
[official-gcc.git] / gcc / testsuite / gfortran.dg / argument_checking_18.f90
blobdd95b6197b02688bc9cd6986981c42bd0048e7f6
1 ! { dg-do compile }
3 ! PR 47349: missing warning: Actual argument contains too few elements
5 ! Contributed by Janus Weil <janus@gcc.gnu.org>
7 implicit none
8 type t
9 integer :: j(3)
10 end type t
12 type(t) :: tt
13 integer :: i(3) = (/ 1,2,3 /)
15 tt%j = i
17 call sub1 (i) ! { dg-warning "Actual argument contains too few elements" }
18 call sub1 (tt%j) ! { dg-warning "Actual argument contains too few elements" }
19 call sub2 (i) ! { dg-error "Rank mismatch in argument" }
20 call sub2 (tt%j) ! { dg-error "Rank mismatch in argument" }
22 contains
24 subroutine sub1(i)
25 integer, dimension(1:3,1:3) :: i
26 print *,"sub1:",i
27 end subroutine
29 subroutine sub2(i)
30 integer, dimension(:,:) :: i
31 print *,"sub2:",i
32 end subroutine
34 end