libgfortran/ChangeLog:
[official-gcc.git] / gcc / testsuite / gfortran.dg / proc_ptr_comp_pass_6.f90
blobb9ce92daecd900cf56335b89c7d3d41144178cd6
1 ! { dg-do compile }
2 ! { dg-options "-fcheck=bounds" }
4 ! PR 42804: ICE with -fcheck=bounds and type bound procedure call on array element
6 ! Contributed by Ian Harvey <ian_harvey@bigpond.com>
8 MODULE ModA
9 IMPLICIT NONE
10 TYPE, PUBLIC :: A
11 PROCEDURE(a_proc),pointer :: Proc
12 END TYPE A
13 CONTAINS
14 SUBROUTINE a_proc(this, stat)
15 CLASS(A), INTENT(INOUT) :: this
16 INTEGER, INTENT(OUT) :: stat
17 WRITE (*, *) 'a_proc'
18 stat = 0
19 END SUBROUTINE a_proc
20 END MODULE ModA
22 PROGRAM ProgA
23 USE ModA
24 IMPLICIT NONE
25 INTEGER :: ierr
26 INTEGER :: i
27 TYPE(A), ALLOCATABLE :: arr(:)
28 ALLOCATE(arr(2))
29 DO i = 1, 2
30 arr(i)%proc => a_proc
31 CALL arr(i)%Proc(ierr)
32 END DO
33 END PROGRAM ProgA