Update concepts branch to revision 131834
[official-gcc.git] / gcc / testsuite / gfortran.dg / argument_checking_3.f90
blob1e01c1f3326b3c08942938bd79d3a16d9ced548a
1 ! { dg-do compile }
3 ! PR fortran/30940
4 program test
5 implicit none
6 interface
7 subroutine foo(a)
8 character(len=1),dimension(:) :: a
9 end subroutine foo
10 subroutine bar(a)
11 character(len=1),dimension(:,:) :: a
12 end subroutine bar
13 subroutine foobar(a)
14 character(len=1),dimension(4) :: a
15 end subroutine foobar
16 subroutine arr(a)
17 character(len=1),dimension(1,2,1,2) :: a
18 end subroutine arr
19 end interface
20 character(len=2) :: len2
21 character(len=4) :: len4
22 len2 = '12'
23 len4 = '1234'
25 call foo(len2) ! { dg-warning "Rank mismatch in argument" }
26 call foo("ca") ! { dg-warning "Rank mismatch in argument" }
27 call bar("ca") ! { dg-warning "Rank mismatch in argument" }
28 call foobar(len2) ! { dg-warning "contains too few elements" }
29 call foobar(len4)
30 call foobar("bar") ! { dg-warning "contains too few elements" }
31 call foobar("bar33")
32 call arr(len2) ! { dg-warning "contains too few elements" }
33 call arr(len4)
34 call arr("bar") ! { dg-warning "contains too few elements" }
35 call arr("bar33")
36 end program test