aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/pr85797.f90
blob: 01d8e640621e9b76741bc498288782dcdd486d11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
! { dg-do compile }
! PR fortran/83515 - ICE: Invalid expression in gfc_element_size 
! PR fortran/85797 - ICE in gfc_element_size, at fortran/target-memory.c:126
! PR fortran/89904 - ICE in gfortran starting with r270045

recursive subroutine a
  c = transfer (a, b)           ! { dg-error "'SOURCE' argument of 'TRANSFER'" }
end

recursive subroutine d
  c = transfer (b, d)           ! { dg-error "'MOLD' argument of 'TRANSFER'" }
end

subroutine f
  use, intrinsic :: iso_c_binding
  integer(c_intptr_t) :: b, c
  procedure(), pointer :: a
  c = transfer (a, b)
  c = transfer (transfer (b, a), b)
end

module m
contains
  function f () result (z)
    class(*), pointer :: z
  end function f
  recursive subroutine s (q)
    procedure(f) :: q
    call s (q)
  end subroutine s
end