gcc/testsuite/gfortran.dg/coarray/proc_pointer_assign_1.f90
raw| 1 | !{ dg-do run } |
| 2 | |
| 3 | ! Check that PR101100 is fixed. |
| 4 | |
| 5 | ! Contributed by G. Steinmetz <[email protected]> |
| 6 | |
| 7 | program p |
| 8 | type t |
| 9 | procedure(), pointer, nopass :: f |
| 10 | end type |
| 11 | |
| 12 | integer :: i = 0 |
| 13 | type(t) :: x[*] |
| 14 | |
| 15 | x%f => null() |
| 16 | if ( associated(x%f) ) stop 1 |
| 17 | |
| 18 | x%f => g |
| 19 | if (.not. associated(x%f) ) stop 2 |
| 20 | |
| 21 | call x%f() |
| 22 | if ( i /= 1 ) stop 3 |
| 23 | |
| 24 | contains |
| 25 | subroutine g() |
| 26 | i = 1 |
| 27 | end subroutine |
| 28 | end |
| 29 |