PR tree-optimization/86415 - strlen() not folded for substrings within constant arrays
[official-gcc.git] / gcc / testsuite / gfortran.dg / dummy_procedure_6.f90
blobdfd51d65a74afc456e6114199ee4fd2da7b6cdef
1 ! { dg-do compile }
3 ! PR 35381: [F95] Shape mismatch check missing for dummy procedure argument
5 ! Contributed by Janus Weil <janus@gcc.gnu.org>
7 module m
9 implicit none
11 contains
13 ! constant array bounds
15 subroutine s1(a)
16 integer :: a(1:2)
17 end subroutine
19 subroutine s2(a)
20 integer :: a(2:3)
21 end subroutine
23 subroutine s3(a)
24 integer :: a(2:4)
25 end subroutine
27 ! non-constant array bounds
29 subroutine t1(a,b)
30 integer :: b
31 integer :: a(1:b,1:b)
32 end subroutine
34 subroutine t2(a,b)
35 integer :: b
36 integer :: a(1:b,2:b+1)
37 end subroutine
39 subroutine t3(a,b)
40 integer :: b
41 integer :: a(1:b,1:b+1)
42 end subroutine
44 end module
47 program test
48 use m
49 implicit none
51 call foo(s1) ! legal
52 call foo(s2) ! legal
53 call foo(s3) ! { dg-error "Shape mismatch in dimension" }
55 call bar(t1) ! legal
56 call bar(t2) ! legal
57 call bar(t3) ! { dg-error "Shape mismatch in dimension" }
59 contains
61 subroutine foo(f)
62 procedure(s1) :: f
63 end subroutine
65 subroutine bar(f)
66 procedure(t1) :: f
67 end subroutine
69 end program