1! { dg-do run }
2! { dg-options "-fcheck=all" }
3!
4! { dg-shouldfail "Pointer check" }
5! { dg-output "Fortran runtime error: Pointer actual argument 'y' is not associated" }
6!
7!
8! PR fortran/50718
9!
10! Was failing (ICE) with -fcheck=pointer if the dummy had the value attribute.
11
12type t
13  integer :: p
14end type t
15
16type(t), pointer :: y => null()
17
18call sub(y) ! Invalid: Nonassociated pointer
19
20contains
21  subroutine sub (x)
22    type(t), value :: x
23  end subroutine
24end
25