aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/pr48958.f90
blob: 2b109374f4014067310f2248223952ea4ad2195a (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
! { dg-do run }
! { dg-options "-fcheck=pointer -fdump-tree-original" }
! { dg-shouldfail "Fortran runtime error: Allocatable argument 'a' is not allocated" }
! { dg-output "At line 13 .*" }
! PR48958 - Add runtime diagnostics for SIZE intrinsic function

program p
  integer :: n
  integer,  allocatable :: a(:)
  integer,  pointer     :: b(:)
  class(*), allocatable :: c(:)
  integer               :: d(10)
  print *, size (a)
  print *, size (b)
  print *, size (c)
  print *, size (d)
  print *, size (f(n))
contains
  function f (n)
    integer, intent(in) :: n
    real, allocatable   :: f(:)
  end function f
end

! { dg-final { scan-tree-dump-times "_gfortran_runtime_error_at" 4 "original" } }